From 3aa603fb4a3438a54d63fceed0a3a50d8fa0bef0 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 13 Aug 2020 17:16:25 -0400 Subject: [PATCH 1/4] adds tests for non zero-padded dates --- tests/draft2019-09/optional/format/date.json | 10 ++++++++++ tests/draft7/optional/format/date.json | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/tests/draft2019-09/optional/format/date.json b/tests/draft2019-09/optional/format/date.json index cd23baae..453b51de 100644 --- a/tests/draft2019-09/optional/format/date.json +++ b/tests/draft2019-09/optional/format/date.json @@ -17,6 +17,16 @@ "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350", "valid": false + }, + { + "description": "invalidates non-padded month dates", + "data": "1998-1-20", + "valid": false + }, + { + "description": "invalidates non-padded day dates", + "data": "1998-01-1", + "valid": false } ] } diff --git a/tests/draft7/optional/format/date.json b/tests/draft7/optional/format/date.json index cd23baae..453b51de 100644 --- a/tests/draft7/optional/format/date.json +++ b/tests/draft7/optional/format/date.json @@ -17,6 +17,16 @@ "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350", "valid": false + }, + { + "description": "invalidates non-padded month dates", + "data": "1998-1-20", + "valid": false + }, + { + "description": "invalidates non-padded day dates", + "data": "1998-01-1", + "valid": false } ] } From f137b8114b9e84c1ea47e7f4b59830dc1b8140dc Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 13 Aug 2020 18:37:11 -0400 Subject: [PATCH 2/4] add checks to draft3 --- tests/draft3/optional/format/date.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/draft3/optional/format/date.json b/tests/draft3/optional/format/date.json index bd830422..4842b487 100644 --- a/tests/draft3/optional/format/date.json +++ b/tests/draft3/optional/format/date.json @@ -12,6 +12,21 @@ "description": "an invalid date string", "data": "06/19/1963", "valid": false + }, + { + "description": "only RFC3339 not all of ISO 8601 are valid", + "data": "2013-350", + "valid": false + }, + { + "description": "invalidates non-padded month dates", + "data": "1998-1-20", + "valid": false + }, + { + "description": "invalidates non-padded day dates", + "data": "1998-01-1", + "valid": false } ] } From df8f6bb9fb45dc6c4e38f6d9293f5160d611c0d6 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 13 Aug 2020 18:37:28 -0400 Subject: [PATCH 3/4] add tests to date-time --- tests/draft2019-09/optional/format/date-time.json | 10 ++++++++++ tests/draft3/optional/format/date-time.json | 10 ++++++++++ tests/draft4/optional/format/date-time.json | 10 ++++++++++ tests/draft6/optional/format/date-time.json | 12 +++++++++++- tests/draft7/optional/format/date-time.json | 10 ++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/tests/draft2019-09/optional/format/date-time.json b/tests/draft2019-09/optional/format/date-time.json index dfccee6e..a3e66860 100644 --- a/tests/draft2019-09/optional/format/date-time.json +++ b/tests/draft2019-09/optional/format/date-time.json @@ -47,6 +47,16 @@ "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false + }, + { + "description": "invalid non-padded month dates", + "data": "1963-6-19T08:30:06.283185Z", + "valid": true + }, + { + "description": "invalid non-padded day dates", + "data": "1963-06-1T08:30:06.283185Z", + "valid": true } ] } diff --git a/tests/draft3/optional/format/date-time.json b/tests/draft3/optional/format/date-time.json index 90279baa..41c65852 100644 --- a/tests/draft3/optional/format/date-time.json +++ b/tests/draft3/optional/format/date-time.json @@ -22,6 +22,16 @@ "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false + }, + { + "description": "invalid non-padded month dates", + "data": "1963-6-19T08:30:06.283185Z", + "valid": true + }, + { + "description": "invalid non-padded day dates", + "data": "1963-06-1T08:30:06.283185Z", + "valid": true } ] } diff --git a/tests/draft4/optional/format/date-time.json b/tests/draft4/optional/format/date-time.json index dfccee6e..a3e66860 100644 --- a/tests/draft4/optional/format/date-time.json +++ b/tests/draft4/optional/format/date-time.json @@ -47,6 +47,16 @@ "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false + }, + { + "description": "invalid non-padded month dates", + "data": "1963-6-19T08:30:06.283185Z", + "valid": true + }, + { + "description": "invalid non-padded day dates", + "data": "1963-06-1T08:30:06.283185Z", + "valid": true } ] } diff --git a/tests/draft6/optional/format/date-time.json b/tests/draft6/optional/format/date-time.json index fc949e90..ba4ce90b 100644 --- a/tests/draft6/optional/format/date-time.json +++ b/tests/draft6/optional/format/date-time.json @@ -37,7 +37,7 @@ "description": "an invalid closing Z after time-zone offset", "data": "1963-06-19T08:30:06.28123+01:00Z", "valid": false - }, + }, { "description": "an invalid date-time string", "data": "06/19/1963 08:30:06 PST", @@ -52,6 +52,16 @@ "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false + }, + { + "description": "invalid non-padded month dates", + "data": "1963-6-19T08:30:06.283185Z", + "valid": true + }, + { + "description": "invalid non-padded day dates", + "data": "1963-06-1T08:30:06.283185Z", + "valid": true } ] } diff --git a/tests/draft7/optional/format/date-time.json b/tests/draft7/optional/format/date-time.json index dfccee6e..a3e66860 100644 --- a/tests/draft7/optional/format/date-time.json +++ b/tests/draft7/optional/format/date-time.json @@ -47,6 +47,16 @@ "description": "only RFC3339 not all of ISO 8601 are valid", "data": "2013-350T01:01:01", "valid": false + }, + { + "description": "invalid non-padded month dates", + "data": "1963-6-19T08:30:06.283185Z", + "valid": true + }, + { + "description": "invalid non-padded day dates", + "data": "1963-06-1T08:30:06.283185Z", + "valid": true } ] } From e61b647138792e06e5419378cca09ecff86c9f46 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Fri, 14 Aug 2020 08:59:54 -0400 Subject: [PATCH 4/4] tests should invalidate --- tests/draft2019-09/optional/format/date-time.json | 4 ++-- tests/draft3/optional/format/date-time.json | 4 ++-- tests/draft4/optional/format/date-time.json | 4 ++-- tests/draft6/optional/format/date-time.json | 4 ++-- tests/draft7/optional/format/date-time.json | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/draft2019-09/optional/format/date-time.json b/tests/draft2019-09/optional/format/date-time.json index a3e66860..900fcb7c 100644 --- a/tests/draft2019-09/optional/format/date-time.json +++ b/tests/draft2019-09/optional/format/date-time.json @@ -51,12 +51,12 @@ { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", - "valid": true + "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", - "valid": true + "valid": false } ] } diff --git a/tests/draft3/optional/format/date-time.json b/tests/draft3/optional/format/date-time.json index 41c65852..58261fad 100644 --- a/tests/draft3/optional/format/date-time.json +++ b/tests/draft3/optional/format/date-time.json @@ -26,12 +26,12 @@ { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", - "valid": true + "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", - "valid": true + "valid": false } ] } diff --git a/tests/draft4/optional/format/date-time.json b/tests/draft4/optional/format/date-time.json index a3e66860..900fcb7c 100644 --- a/tests/draft4/optional/format/date-time.json +++ b/tests/draft4/optional/format/date-time.json @@ -51,12 +51,12 @@ { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", - "valid": true + "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", - "valid": true + "valid": false } ] } diff --git a/tests/draft6/optional/format/date-time.json b/tests/draft6/optional/format/date-time.json index ba4ce90b..a6320a90 100644 --- a/tests/draft6/optional/format/date-time.json +++ b/tests/draft6/optional/format/date-time.json @@ -56,12 +56,12 @@ { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", - "valid": true + "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", - "valid": true + "valid": false } ] } diff --git a/tests/draft7/optional/format/date-time.json b/tests/draft7/optional/format/date-time.json index a3e66860..900fcb7c 100644 --- a/tests/draft7/optional/format/date-time.json +++ b/tests/draft7/optional/format/date-time.json @@ -51,12 +51,12 @@ { "description": "invalid non-padded month dates", "data": "1963-6-19T08:30:06.283185Z", - "valid": true + "valid": false }, { "description": "invalid non-padded day dates", "data": "1963-06-1T08:30:06.283185Z", - "valid": true + "valid": false } ] }