Skip to content

Commit b503b77

Browse files
committed
Sync gigasecond test cases (exercism#775)
[no important files changed]
1 parent 4da6f15 commit b503b77

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

exercises/practice/gigasecond/.meta/tests.toml

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[92fbe71c-ea52-4fac-bd77-be38023cacf7]
613
description = "date only specification of time"
@@ -16,3 +23,7 @@ description = "full time specified"
1623

1724
[09d4e30e-728a-4b52-9005-be44a58d9eba]
1825
description = "full time with day roll-over"
26+
27+
[fcec307c-7529-49ab-b0fe-20309197618a]
28+
description = "does not mutate the input"
29+
include = false

exercises/practice/gigasecond/gigasecond_test.cpp

+19-15
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,46 @@
1414

1515
using namespace boost::posix_time;
1616

17-
TEST_CASE("test_1")
18-
{
19-
const ptime actual = gigasecond::advance(time_from_string("2011-04-25 00:00:00"));
17+
TEST_CASE("date only specification of time",
18+
"[92fbe71c-ea52-4fac-bd77-be38023cacf7]") {
19+
const ptime actual =
20+
gigasecond::advance(time_from_string("2011-04-25 00:00:00"));
2021

2122
const ptime expected(time_from_string("2043-01-01 01:46:40"));
2223
REQUIRE(expected == actual);
2324
}
2425

2526
#if defined(EXERCISM_RUN_ALL_TESTS)
26-
TEST_CASE("test_2")
27-
{
28-
const auto actual = gigasecond::advance(time_from_string("1977-06-13 00:00:00"));
27+
TEST_CASE("second test for date only specification of time",
28+
"[6d86dd16-6f7a-47be-9e58-bb9fb2ae1433]") {
29+
const auto actual =
30+
gigasecond::advance(time_from_string("1977-06-13 00:00:00"));
2931

3032
const ptime expected(time_from_string("2009-02-19 01:46:40"));
3133
REQUIRE(expected == actual);
3234
}
3335

34-
TEST_CASE("test_3")
35-
{
36-
const auto actual = gigasecond::advance(time_from_string("1959-07-19 00:00:00"));
36+
TEST_CASE("third test for date only specification of time",
37+
"[77eb8502-2bca-4d92-89d9-7b39ace28dd5]") {
38+
const auto actual =
39+
gigasecond::advance(time_from_string("1959-07-19 00:00:00"));
3740

3841
const ptime expected(time_from_string("1991-03-27 01:46:40"));
3942
REQUIRE(expected == actual);
4043
}
4144

42-
TEST_CASE("test_4")
43-
{
44-
const auto actual = gigasecond::advance(time_from_string("2015-01-24 22:00:00"));
45+
TEST_CASE("full time specified", "[c9d89a7d-06f8-4e28-a305-64f1b2abc693]") {
46+
const auto actual =
47+
gigasecond::advance(time_from_string("2015-01-24 22:00:00"));
4548

4649
const ptime expected(time_from_string("2046-10-02 23:46:40"));
4750
REQUIRE(expected == actual);
4851
}
4952

50-
TEST_CASE("test_5")
51-
{
52-
const auto actual = gigasecond::advance(time_from_string("2015-01-24 23:59:59"));
53+
TEST_CASE("full time with day roll-over",
54+
"[09d4e30e-728a-4b52-9005-be44a58d9eba]") {
55+
const auto actual =
56+
gigasecond::advance(time_from_string("2015-01-24 23:59:59"));
5357

5458
const ptime expected(time_from_string("2046-10-03 01:46:39"));
5559
REQUIRE(expected == actual);

0 commit comments

Comments
 (0)