forked from exercism/problem-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgigasecond.json
45 lines (45 loc) · 1.45 KB
/
gigasecond.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"#": [
"The basic test is to add one gigasecond to a few ordinary dates.",
"Most test programs currently check only the date and ignore the time.",
"For languages with a native date-time type though, expected times",
"here show the correct seconds, ignoring leap seconds.",
"The date and time formats here are per",
"http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15.",
"",
"Finally, as a demonstration but not really a test,",
"some languages demonstrate the add function by inviting the",
"solver to include their birthdate in either the solution code",
"or test program. The test program then shows or tests their",
"gigasecond anniversay."
],
"add": {
"description": [
"Add one gigasecond to the input."
],
"cases": [
{
"input": "2011-04-25",
"expected": "2043-01-01T01:46:40"
},
{
"input": "1977-06-13",
"expected": "2009-02-19T01:46:40"
},
{
"input": "1959-07-19",
"expected": "1991-03-27T01:46:40"
},
{
"#": "full time specified",
"input": "2015-01-24T22:00:00",
"expected": "2046-10-02T23:46:40"
},
{
"#": "full time with day roll-over",
"input": "2015-01-24T23:59:59",
"expected": "2046-10-03T01:46:39"
}
]
}
}