Skip to content

Commit fce9e9b

Browse files
authored
Merge pull request #426 from helrond/padded-dates
Adds tests for non zero-padded dates
2 parents 86f52b8 + e61b647 commit fce9e9b

File tree

8 files changed

+86
-1
lines changed

8 files changed

+86
-1
lines changed

tests/draft2019-09/optional/format/date-time.json

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
"description": "only RFC3339 not all of ISO 8601 are valid",
4848
"data": "2013-350T01:01:01",
4949
"valid": false
50+
},
51+
{
52+
"description": "invalid non-padded month dates",
53+
"data": "1963-6-19T08:30:06.283185Z",
54+
"valid": false
55+
},
56+
{
57+
"description": "invalid non-padded day dates",
58+
"data": "1963-06-1T08:30:06.283185Z",
59+
"valid": false
5060
}
5161
]
5262
}

tests/draft2019-09/optional/format/date.json

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
"description": "only RFC3339 not all of ISO 8601 are valid",
1818
"data": "2013-350",
1919
"valid": false
20+
},
21+
{
22+
"description": "invalidates non-padded month dates",
23+
"data": "1998-1-20",
24+
"valid": false
25+
},
26+
{
27+
"description": "invalidates non-padded day dates",
28+
"data": "1998-01-1",
29+
"valid": false
2030
}
2131
]
2232
}

tests/draft3/optional/format/date-time.json

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
"description": "only RFC3339 not all of ISO 8601 are valid",
2323
"data": "2013-350T01:01:01",
2424
"valid": false
25+
},
26+
{
27+
"description": "invalid non-padded month dates",
28+
"data": "1963-6-19T08:30:06.283185Z",
29+
"valid": false
30+
},
31+
{
32+
"description": "invalid non-padded day dates",
33+
"data": "1963-06-1T08:30:06.283185Z",
34+
"valid": false
2535
}
2636
]
2737
}

tests/draft3/optional/format/date.json

+15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@
1212
"description": "an invalid date string",
1313
"data": "06/19/1963",
1414
"valid": false
15+
},
16+
{
17+
"description": "only RFC3339 not all of ISO 8601 are valid",
18+
"data": "2013-350",
19+
"valid": false
20+
},
21+
{
22+
"description": "invalidates non-padded month dates",
23+
"data": "1998-1-20",
24+
"valid": false
25+
},
26+
{
27+
"description": "invalidates non-padded day dates",
28+
"data": "1998-01-1",
29+
"valid": false
1530
}
1631
]
1732
}

tests/draft4/optional/format/date-time.json

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
"description": "only RFC3339 not all of ISO 8601 are valid",
4848
"data": "2013-350T01:01:01",
4949
"valid": false
50+
},
51+
{
52+
"description": "invalid non-padded month dates",
53+
"data": "1963-6-19T08:30:06.283185Z",
54+
"valid": false
55+
},
56+
{
57+
"description": "invalid non-padded day dates",
58+
"data": "1963-06-1T08:30:06.283185Z",
59+
"valid": false
5060
}
5161
]
5262
}

tests/draft6/optional/format/date-time.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"description": "an invalid closing Z after time-zone offset",
3838
"data": "1963-06-19T08:30:06.28123+01:00Z",
3939
"valid": false
40-
},
40+
},
4141
{
4242
"description": "an invalid date-time string",
4343
"data": "06/19/1963 08:30:06 PST",
@@ -52,6 +52,16 @@
5252
"description": "only RFC3339 not all of ISO 8601 are valid",
5353
"data": "2013-350T01:01:01",
5454
"valid": false
55+
},
56+
{
57+
"description": "invalid non-padded month dates",
58+
"data": "1963-6-19T08:30:06.283185Z",
59+
"valid": false
60+
},
61+
{
62+
"description": "invalid non-padded day dates",
63+
"data": "1963-06-1T08:30:06.283185Z",
64+
"valid": false
5565
}
5666
]
5767
}

tests/draft7/optional/format/date-time.json

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
"description": "only RFC3339 not all of ISO 8601 are valid",
4848
"data": "2013-350T01:01:01",
4949
"valid": false
50+
},
51+
{
52+
"description": "invalid non-padded month dates",
53+
"data": "1963-6-19T08:30:06.283185Z",
54+
"valid": false
55+
},
56+
{
57+
"description": "invalid non-padded day dates",
58+
"data": "1963-06-1T08:30:06.283185Z",
59+
"valid": false
5060
}
5161
]
5262
}

tests/draft7/optional/format/date.json

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
"description": "only RFC3339 not all of ISO 8601 are valid",
1818
"data": "2013-350",
1919
"valid": false
20+
},
21+
{
22+
"description": "invalidates non-padded month dates",
23+
"data": "1998-1-20",
24+
"valid": false
25+
},
26+
{
27+
"description": "invalidates non-padded day dates",
28+
"data": "1998-01-1",
29+
"valid": false
2030
}
2131
]
2232
}

0 commit comments

Comments
 (0)