From b4a3709899a7f1ec3a9f871652b3985ac760b19b Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Tue, 24 Mar 2026 18:26:25 +0530 Subject: [PATCH 1/5] test(draft2020-12): add leap year boundary tests for date format --- tests/draft2020-12/optional/format/date.json | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/draft2020-12/optional/format/date.json b/tests/draft2020-12/optional/format/date.json index 01731c34..b18b135f 100644 --- a/tests/draft2020-12/optional/format/date.json +++ b/tests/draft2020-12/optional/format/date.json @@ -245,6 +245,54 @@ "description": "an invalid time string in date-time format", "data": "2020-11-28T23:55:45Z", "valid": false + }, + { + "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", + "data": "0000-02-29", + "valid": true + }, + { + "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", + "data": "0100-02-29", + "valid": false + }, + { + "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", + "data": "0400-02-29", + "valid": true + }, + { + "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", + "data": "2100-02-29", + "valid": false + }, + { + "description": "invalid: leading whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": " 2024-01-15", + "valid": false + }, + { + "description": "invalid: trailing whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": "2024-01-15 ", + "valid": false + }, + { + "description": "invalid: month 00 is not valid per date-month range 01-12", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12", + "data": "2024-00-15", + "valid": false + }, + { + "description": "invalid: day 00 is not valid per date-mday minimum of 01", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31", + "data": "2024-01-00", + "valid": false } ] } From ac5d35a442cf87a69f5e3363605d8342abc4933b Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Tue, 24 Mar 2026 18:26:45 +0530 Subject: [PATCH 2/5] test(draft2019-09): add leap year boundary tests for date format --- tests/draft2019-09/optional/format/date.json | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/draft2019-09/optional/format/date.json b/tests/draft2019-09/optional/format/date.json index 1ba5d9ca..06f13b7a 100644 --- a/tests/draft2019-09/optional/format/date.json +++ b/tests/draft2019-09/optional/format/date.json @@ -245,6 +245,54 @@ "description": "an invalid time string in date-time format", "data": "2020-11-28T23:55:45Z", "valid": false + }, + { + "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", + "data": "0000-02-29", + "valid": true + }, + { + "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", + "data": "0100-02-29", + "valid": false + }, + { + "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", + "data": "0400-02-29", + "valid": true + }, + { + "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", + "data": "2100-02-29", + "valid": false + }, + { + "description": "invalid: leading whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": " 2024-01-15", + "valid": false + }, + { + "description": "invalid: trailing whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": "2024-01-15 ", + "valid": false + }, + { + "description": "invalid: month 00 is not valid per date-month range 01-12", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12", + "data": "2024-00-15", + "valid": false + }, + { + "description": "invalid: day 00 is not valid per date-mday minimum of 01", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31", + "data": "2024-01-00", + "valid": false } ] } From a2b70d89c8c32c5b7a2b97154d5ff78b940a63f7 Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Tue, 24 Mar 2026 18:27:03 +0530 Subject: [PATCH 3/5] test(draft7): add leap year boundary tests for year 0000 and century years --- tests/draft7/optional/format/date.json | 48 ++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/draft7/optional/format/date.json b/tests/draft7/optional/format/date.json index 2cfdcf3f..f22a0c76 100644 --- a/tests/draft7/optional/format/date.json +++ b/tests/draft7/optional/format/date.json @@ -242,6 +242,54 @@ "description": "an invalid time string in date-time format", "data": "2020-11-28T23:55:45Z", "valid": false + }, + { + "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", + "data": "0000-02-29", + "valid": true + }, + { + "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", + "data": "0100-02-29", + "valid": false + }, + { + "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", + "data": "0400-02-29", + "valid": true + }, + { + "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", + "data": "2100-02-29", + "valid": false + }, + { + "description": "invalid: leading whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": " 2024-01-15", + "valid": false + }, + { + "description": "invalid: trailing whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": "2024-01-15 ", + "valid": false + }, + { + "description": "invalid: month 00 is not valid per date-month range 01-12", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12", + "data": "2024-00-15", + "valid": false + }, + { + "description": "invalid: day 00 is not valid per date-mday minimum of 01", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31", + "data": "2024-01-00", + "valid": false } ] } From 93d9dcdea00f68299aa36984a675b537752ed2f0 Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Tue, 24 Mar 2026 18:27:18 +0530 Subject: [PATCH 4/5] test(date): add leap year boundary tests for year 0000 and century years --- tests/v1/format/date.json | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/v1/format/date.json b/tests/v1/format/date.json index f120d37e..fe53028d 100644 --- a/tests/v1/format/date.json +++ b/tests/v1/format/date.json @@ -245,6 +245,54 @@ "description": "an invalid time string in date-time format", "data": "2020-11-28T23:55:45Z", "valid": false + }, + { + "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", + "data": "0000-02-29", + "valid": true + }, + { + "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", + "data": "0100-02-29", + "valid": false + }, + { + "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", + "data": "0400-02-29", + "valid": true + }, + { + "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", + "data": "2100-02-29", + "valid": false + }, + { + "description": "invalid: leading whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": " 2024-01-15", + "valid": false + }, + { + "description": "invalid: trailing whitespace is not permitted", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace", + "data": "2024-01-15 ", + "valid": false + }, + { + "description": "invalid: month 00 is not valid per date-month range 01-12", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12", + "data": "2024-00-15", + "valid": false + }, + { + "description": "invalid: day 00 is not valid per date-mday minimum of 01", + "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31", + "data": "2024-01-00", + "valid": false } ] } From b5253b2729eb7adf60c5357d602b81dedbc834b5 Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Tue, 24 Mar 2026 18:40:18 +0530 Subject: [PATCH 5/5] fix: shorten test descriptions to meet <70 char limit --- tests/draft2019-09/optional/format/date.json | 8 ++++---- tests/draft2020-12/optional/format/date.json | 8 ++++---- tests/draft7/optional/format/date.json | 8 ++++---- tests/v1/format/date.json | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/draft2019-09/optional/format/date.json b/tests/draft2019-09/optional/format/date.json index 06f13b7a..652238c3 100644 --- a/tests/draft2019-09/optional/format/date.json +++ b/tests/draft2019-09/optional/format/date.json @@ -247,25 +247,25 @@ "valid": false }, { - "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "description": "year 0000 is a leap year (0 % 400 == 0)", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", "data": "0000-02-29", "valid": true }, { - "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "description": "century year 0100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", "data": "0100-02-29", "valid": false }, { - "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "description": "century year 0400 is a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", "data": "0400-02-29", "valid": true }, { - "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "description": "century year 2100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", "data": "2100-02-29", "valid": false diff --git a/tests/draft2020-12/optional/format/date.json b/tests/draft2020-12/optional/format/date.json index b18b135f..7e5df1ac 100644 --- a/tests/draft2020-12/optional/format/date.json +++ b/tests/draft2020-12/optional/format/date.json @@ -247,25 +247,25 @@ "valid": false }, { - "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "description": "year 0000 is a leap year (0 % 400 == 0)", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", "data": "0000-02-29", "valid": true }, { - "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "description": "century year 0100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", "data": "0100-02-29", "valid": false }, { - "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "description": "century year 0400 is a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", "data": "0400-02-29", "valid": true }, { - "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "description": "century year 2100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", "data": "2100-02-29", "valid": false diff --git a/tests/draft7/optional/format/date.json b/tests/draft7/optional/format/date.json index f22a0c76..05d9a035 100644 --- a/tests/draft7/optional/format/date.json +++ b/tests/draft7/optional/format/date.json @@ -244,25 +244,25 @@ "valid": false }, { - "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "description": "year 0000 is a leap year (0 % 400 == 0)", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", "data": "0000-02-29", "valid": true }, { - "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "description": "century year 0100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", "data": "0100-02-29", "valid": false }, { - "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "description": "century year 0400 is a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", "data": "0400-02-29", "valid": true }, { - "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "description": "century year 2100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", "data": "2100-02-29", "valid": false diff --git a/tests/v1/format/date.json b/tests/v1/format/date.json index fe53028d..0285b4e4 100644 --- a/tests/v1/format/date.json +++ b/tests/v1/format/date.json @@ -247,25 +247,25 @@ "valid": false }, { - "description": "valid: year 0000 is a leap year per RFC 3339 Appendix C (0 % 400 == 0)", + "description": "year 0000 is a leap year (0 % 400 == 0)", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case", "data": "0000-02-29", "valid": true }, { - "description": "invalid: century year 0100 is not divisible by 400, so not a leap year", + "description": "century year 0100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0", "data": "0100-02-29", "valid": false }, { - "description": "valid: century year 0400 is divisible by 400, so it is a leap year", + "description": "century year 0400 is a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary", "data": "0400-02-29", "valid": true }, { - "description": "invalid: century year 2100 is not divisible by 400, so not a leap year", + "description": "century year 2100 is not a leap year", "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year", "data": "2100-02-29", "valid": false