Skip to content

Commit ebe4d6c

Browse files
authored
Add date and datetime scenarios to gigasecond (#2123)
* Alphabetize scenario entries This alphabetizes the entries in both the SCENARIOS.txt file as well as the canonical-data schema file, in order to make it easier to find entries as the list grows. * Add date and datetime scenarios * Add date and datetime scenarios to gigasecond The gigasecond test suite is a bit odd in that there are two different types for the same input. Another oddity of the gigasecond test suite is that most of the tests don't actually add any value. If you get one passing, you get them all passing. This adds a date scenario to the inputs that have only a date, and datetime to the ones that also include a time element.
1 parent afa89ca commit ebe4d6c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

SCENARIOS.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
big-integer
2+
date
3+
datetime
24
floating-point
35
immutable
6+
input-validation
47
library-test
58
local-scope
6-
unicode
7-
input-validation
89
runtime-validation
10+
unicode

canonical-data.schema.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@
120120
"type": "string",
121121
"enum": [
122122
"big-integer",
123+
"date",
124+
"datetime",
123125
"floating-point",
124126
"immutable",
127+
"input-validation",
125128
"library-test",
126129
"local-scope",
127-
"unicode",
128-
"input-validation",
129-
"runtime-validation"
130+
"runtime-validation",
131+
"unicode"
130132
]
131133
},
132134

exercises/gigasecond/canonical-data.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
{
1919
"uuid": "92fbe71c-ea52-4fac-bd77-be38023cacf7",
2020
"description": "date only specification of time",
21+
"scenarios": ["date"],
2122
"property": "add",
2223
"input": {
2324
"moment": "2011-04-25"
@@ -27,6 +28,7 @@
2728
{
2829
"uuid": "6d86dd16-6f7a-47be-9e58-bb9fb2ae1433",
2930
"description": "second test for date only specification of time",
31+
"scenarios": ["date"],
3032
"property": "add",
3133
"input": {
3234
"moment": "1977-06-13"
@@ -36,6 +38,7 @@
3638
{
3739
"uuid": "77eb8502-2bca-4d92-89d9-7b39ace28dd5",
3840
"description": "third test for date only specification of time",
41+
"scenarios": ["date"],
3942
"property": "add",
4043
"input": {
4144
"moment": "1959-07-19"
@@ -45,6 +48,7 @@
4548
{
4649
"uuid": "c9d89a7d-06f8-4e28-a305-64f1b2abc693",
4750
"description": "full time specified",
51+
"scenarios": ["datetime"],
4852
"property": "add",
4953
"input": {
5054
"moment": "2015-01-24T22:00:00"
@@ -54,6 +58,7 @@
5458
{
5559
"uuid": "09d4e30e-728a-4b52-9005-be44a58d9eba",
5660
"description": "full time with day roll-over",
61+
"scenarios": ["datetime"],
5762
"property": "add",
5863
"input": {
5964
"moment": "2015-01-24T23:59:59"

0 commit comments

Comments
 (0)