diff --git a/schemas/iso/datetime/2019/date-calendar-basic.json b/schemas/iso/datetime/2019/date-calendar-basic.json new file mode 100644 index 00000000..67b5890c --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-basic.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Date (Basic Format)", + "description": "A complete representation of a calendar date in basic format [YYYY][MM][DD] (§5.2.2.1 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "19850412", "20000101", "20231231", "00000101", "99991231" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^([0-9]{4}(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01])|[0-9]{4}(0[469]|11)(0[1-9]|[12][0-9]|30)|[0-9]{4}02(0[1-9]|1[0-9]|2[0-9]))$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-century.json b/schemas/iso/datetime/2019/date-calendar-century.json new file mode 100644 index 00000000..d333f3db --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-century.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Century", + "description": "A calendar date with reduced precision representing a specific century [YY] (§5.2.2.2 d)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "19", "20", "00", "99" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{2}$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-decade.json b/schemas/iso/datetime/2019/date-calendar-decade.json new file mode 100644 index 00000000..93fe9058 --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-decade.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Decade", + "description": "A calendar date with reduced precision representing a specific decade [YYY] (§5.2.2.2 c)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "198", "200", "202", "000", "999" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{3}$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-expanded-basic.json b/schemas/iso/datetime/2019/date-calendar-expanded-basic.json new file mode 100644 index 00000000..477d9e51 --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-expanded-basic.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Date Expanded (Basic Format)", + "description": "An expanded representation of a calendar date in basic format [±][YYYYYY][MM][DD] with six digits for the year (§5.2.2.3 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+0019850412", + "-0000010101", + "+9999991231", + "+0000000101", + "-0100000101" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^([+-][0-9]{6}(0[13578]|1[02])(0[1-9]|[12][0-9]|3[01])|[+-][0-9]{6}(0[469]|11)(0[1-9]|[12][0-9]|30)|[+-][0-9]{6}02(0[1-9]|1[0-9]|2[0-9]))$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-expanded-century.json b/schemas/iso/datetime/2019/date-calendar-expanded-century.json new file mode 100644 index 00000000..ea4fa6bb --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-expanded-century.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Century Expanded", + "description": "An expanded representation of a calendar century [±][YYYY] with four digits (§5.2.2.3 e)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "+0019", "-0000", "+9999", "+0000", "-0100" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{4}$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-expanded-decade.json b/schemas/iso/datetime/2019/date-calendar-expanded-decade.json new file mode 100644 index 00000000..2665f77f --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-expanded-decade.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Decade Expanded", + "description": "An expanded representation of a calendar decade [±][YYYYY] with five digits (§5.2.2.3 d)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "+00198", "-00000", "+99999", "+00000", "-01000" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{5}$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-expanded-extended.json b/schemas/iso/datetime/2019/date-calendar-expanded-extended.json new file mode 100644 index 00000000..977ef43b --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-expanded-extended.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Date Expanded (Extended Format)", + "description": "An expanded representation of a calendar date in extended format [±][YYYYYY][\"-\"][MM][\"-\"][DD] with six digits for the year (§5.2.2.3 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985-04-12", + "-000001-01-01", + "+999999-12-31", + "+000000-01-01", + "-010000-01-01" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^([+-][0-9]{6}-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|[+-][0-9]{6}-(0[469]|11)-(0[1-9]|[12][0-9]|30)|[+-][0-9]{6}-02-(0[1-9]|1[0-9]|2[0-9]))$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-expanded-month.json b/schemas/iso/datetime/2019/date-calendar-expanded-month.json new file mode 100644 index 00000000..08e3ef60 --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-expanded-month.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Month Expanded (Extended Format)", + "description": "An expanded representation of a calendar month in extended format [±][YYYYYY][\"-\"][MM] with six digits for the year (§5.2.2.3 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985-04", + "-000001-01", + "+999999-12", + "+000000-01", + "-010000-12" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}-(0[1-9]|1[0-2])$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-expanded-year.json b/schemas/iso/datetime/2019/date-calendar-expanded-year.json new file mode 100644 index 00000000..1f443b18 --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-expanded-year.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Year Expanded", + "description": "An expanded representation of a calendar year [±][YYYYYY] with six digits for the year (§5.2.2.3 c)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "+001985", "-000001", "+999999", "+000000", "-010000" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-extended.json b/schemas/iso/datetime/2019/date-calendar-extended.json new file mode 100644 index 00000000..4e84523b --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-extended.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Date (Extended Format)", + "description": "A complete representation of a calendar date in extended format [YYYY][\"-\"][MM][\"-\"][DD] (§5.2.2.1 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "1985-04-12", + "2000-01-01", + "2023-12-31", + "0000-01-01", + "9999-12-31" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^([0-9]{4}-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|[0-9]{4}-(0[469]|11)-(0[1-9]|[12][0-9]|30)|[0-9]{4}-02-(0[1-9]|1[0-9]|2[0-9]))$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-month.json b/schemas/iso/datetime/2019/date-calendar-month.json new file mode 100644 index 00000000..fd3dd133 --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-month.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Month (Extended Format)", + "description": "A calendar date with reduced precision representing a specific calendar month [YYYY][\"-\"][MM] (§5.2.2.2 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "1985-04", "2000-01", "2023-12", "0000-01", "9999-12" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$" +} diff --git a/schemas/iso/datetime/2019/date-calendar-year.json b/schemas/iso/datetime/2019/date-calendar-year.json new file mode 100644 index 00000000..77b82a47 --- /dev/null +++ b/schemas/iso/datetime/2019/date-calendar-year.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Calendar Year", + "description": "A calendar date with reduced precision representing a specific calendar year [YYYY] (§5.2.2.2 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "1985", "2000", "2023", "0000", "9999" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}$" +} diff --git a/schemas/iso/datetime/2019/date-ordinal-basic.json b/schemas/iso/datetime/2019/date-ordinal-basic.json new file mode 100644 index 00000000..17020f6b --- /dev/null +++ b/schemas/iso/datetime/2019/date-ordinal-basic.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Ordinal Date (Basic Format)", + "description": "A complete representation of an ordinal date in basic format [YYYY][DDD] where DDD is the calendar day of year (001-365/366) (§5.2.3.1 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "1985102", "2000001", "2000366", "2023365", "0000001" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])$" +} diff --git a/schemas/iso/datetime/2019/date-ordinal-expanded-basic.json b/schemas/iso/datetime/2019/date-ordinal-expanded-basic.json new file mode 100644 index 00000000..6c6752ac --- /dev/null +++ b/schemas/iso/datetime/2019/date-ordinal-expanded-basic.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Ordinal Date Expanded (Basic Format)", + "description": "An expanded representation of an ordinal date in basic format [±][YYYYYY][DDD] with six digits for the year and DDD as calendar day of year (001-365/366) (§5.2.3.2 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985102", + "-000001001", + "+999999366", + "+000000001", + "-010000365" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])$" +} diff --git a/schemas/iso/datetime/2019/date-ordinal-expanded-extended.json b/schemas/iso/datetime/2019/date-ordinal-expanded-extended.json new file mode 100644 index 00000000..8d25275d --- /dev/null +++ b/schemas/iso/datetime/2019/date-ordinal-expanded-extended.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Ordinal Date Expanded (Extended Format)", + "description": "An expanded representation of an ordinal date in extended format [±][YYYYYY][\"-\"][DDD] with six digits for the year and DDD as calendar day of year (001-365/366) (§5.2.3.2 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985-102", + "-000001-001", + "+999999-366", + "+000000-001", + "-010000-365" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}-(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])$" +} diff --git a/schemas/iso/datetime/2019/date-ordinal-extended.json b/schemas/iso/datetime/2019/date-ordinal-extended.json new file mode 100644 index 00000000..5db863ff --- /dev/null +++ b/schemas/iso/datetime/2019/date-ordinal-extended.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Ordinal Date (Extended Format)", + "description": "A complete representation of an ordinal date in extended format [YYYY][\"-\"][DDD] where DDD is the calendar day of year (001-365/366) (§5.2.3.1 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "1985-102", "2000-001", "2000-366", "2023-365", "0000-001" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}-(00[1-9]|0[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6])$" +} diff --git a/schemas/iso/datetime/2019/date-week-basic.json b/schemas/iso/datetime/2019/date-week-basic.json new file mode 100644 index 00000000..cd881ad2 --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-basic.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date (Basic Format)", + "description": "A complete representation of a week date in basic format [YYYY][\"W\"][WW][D] where WW is the calendar week of year (01-53) and D is the calendar day of week (1-7) (§5.2.4.1 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "1985W155", "2000W011", "2023W527", "0000W011", "9999W537" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}W(0[1-9]|[1-4][0-9]|5[0-3])[1-7]$" +} diff --git a/schemas/iso/datetime/2019/date-week-expanded-basic.json b/schemas/iso/datetime/2019/date-week-expanded-basic.json new file mode 100644 index 00000000..a9d81c31 --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-expanded-basic.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date Expanded (Basic Format)", + "description": "An expanded representation of a week date in basic format [±][YYYYYY][\"W\"][WW][D] with six digits for the year, WW as calendar week of year (01-53), and D as calendar day of week (1-7) (§5.2.4.3 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985W155", + "-000001W011", + "+999999W537", + "+000000W011", + "-010000W527" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}W(0[1-9]|[1-4][0-9]|5[0-3])[1-7]$" +} diff --git a/schemas/iso/datetime/2019/date-week-expanded-extended.json b/schemas/iso/datetime/2019/date-week-expanded-extended.json new file mode 100644 index 00000000..750d4a74 --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-expanded-extended.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date Expanded (Extended Format)", + "description": "An expanded representation of a week date in extended format [±][YYYYYY][\"-\"][\"W\"][WW][\"-\"][D] with six digits for the year, WW as calendar week of year (01-53), and D as calendar day of week (1-7) (§5.2.4.3 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985-W15-5", + "-000001-W01-1", + "+999999-W53-7", + "+000000-W01-1", + "-010000-W52-7" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}-W(0[1-9]|[1-4][0-9]|5[0-3])-[1-7]$" +} diff --git a/schemas/iso/datetime/2019/date-week-expanded-reduced-basic.json b/schemas/iso/datetime/2019/date-week-expanded-reduced-basic.json new file mode 100644 index 00000000..3b299db8 --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-expanded-reduced-basic.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date Expanded Reduced Precision (Basic Format)", + "description": "An expanded representation of a week date with reduced precision in basic format [±][YYYYYY][\"W\"][WW] with six digits for the year and WW as calendar week of year (01-53) (§5.2.4.3 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985W15", + "-000001W01", + "+999999W53", + "+000000W01", + "-010000W52" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}W(0[1-9]|[1-4][0-9]|5[0-3])$" +} diff --git a/schemas/iso/datetime/2019/date-week-expanded-reduced-extended.json b/schemas/iso/datetime/2019/date-week-expanded-reduced-extended.json new file mode 100644 index 00000000..a9347c40 --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-expanded-reduced-extended.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date Expanded Reduced Precision (Extended Format)", + "description": "An expanded representation of a week date with reduced precision in extended format [±][YYYYYY][\"-\"][\"W\"][WW] with six digits for the year and WW as calendar week of year (01-53) (§5.2.4.3 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "+001985-W15", + "-000001-W01", + "+999999-W53", + "+000000-W01", + "-010000-W52" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[+-][0-9]{6}-W(0[1-9]|[1-4][0-9]|5[0-3])$" +} diff --git a/schemas/iso/datetime/2019/date-week-extended.json b/schemas/iso/datetime/2019/date-week-extended.json new file mode 100644 index 00000000..cf5b848f --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-extended.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date (Extended Format)", + "description": "A complete representation of a week date in extended format [YYYY][\"-\"][\"W\"][WW][\"-\"][D] where WW is the calendar week of year (01-53) and D is the calendar day of week (1-7) (§5.2.4.1 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ + "1985-W15-5", + "2000-W01-1", + "2023-W52-7", + "0000-W01-1", + "9999-W53-7" + ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}-W(0[1-9]|[1-4][0-9]|5[0-3])-[1-7]$" +} diff --git a/schemas/iso/datetime/2019/date-week-reduced-basic.json b/schemas/iso/datetime/2019/date-week-reduced-basic.json new file mode 100644 index 00000000..44334522 --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-reduced-basic.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date Reduced Precision (Basic Format)", + "description": "A week date with reduced precision in basic format [YYYY][\"W\"][WW] where WW is the calendar week of year (01-53) (§5.2.4.2 a)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "1985W15", "2000W01", "2023W52", "0000W01", "9999W53" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}W(0[1-9]|[1-4][0-9]|5[0-3])$" +} diff --git a/schemas/iso/datetime/2019/date-week-reduced-extended.json b/schemas/iso/datetime/2019/date-week-reduced-extended.json new file mode 100644 index 00000000..ce96b2d9 --- /dev/null +++ b/schemas/iso/datetime/2019/date-week-reduced-extended.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 8601-1:2019 Week Date Reduced Precision (Extended Format)", + "description": "A week date with reduced precision in extended format [YYYY][\"-\"][\"W\"][WW] where WW is the calendar week of year (01-53) (§5.2.4.2 b)", + "$comment": "https://www.iso.org/standard/70907.html", + "examples": [ "1985-W15", "2000-W01", "2023-W52", "0000-W01", "9999-W53" ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "type": "string", + "pattern": "^[0-9]{4}-W(0[1-9]|[1-4][0-9]|5[0-3])$" +} diff --git a/test/iso/datetime/2019/date-calendar-basic.test.json b/test/iso/datetime/2019/date-calendar-basic.test.json new file mode 100644 index 00000000..bd87b9af --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-basic.test.json @@ -0,0 +1,261 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 19850412, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + }, + { + "description": "Valid - 12 April 1985", + "data": "19850412", + "valid": true + }, + { + "description": "Valid - 1 January 2000", + "data": "20000101", + "valid": true + }, + { + "description": "Valid - 31 December 2023", + "data": "20231231", + "valid": true + }, + { + "description": "Valid - 1 January year 0000", + "data": "00000101", + "valid": true + }, + { + "description": "Valid - 31 December year 9999", + "data": "99991231", + "valid": true + }, + { + "description": "Valid - 29 February 2000 (leap year)", + "data": "20000229", + "valid": true + }, + { + "description": "Valid - 29 February 2004 (leap year)", + "data": "20040229", + "valid": true + }, + { + "description": "Valid - 28 February 2001 (non-leap year)", + "data": "20010228", + "valid": true + }, + { + "description": "Valid - 31 January 2023", + "data": "20230131", + "valid": true + }, + { + "description": "Valid - 30 April 2023", + "data": "20230430", + "valid": true + }, + { + "description": "Valid - 31 May 2023", + "data": "20230531", + "valid": true + }, + { + "description": "Valid - 30 June 2023", + "data": "20230630", + "valid": true + }, + { + "description": "Valid - 31 July 2023", + "data": "20230731", + "valid": true + }, + { + "description": "Valid - 31 August 2023", + "data": "20230831", + "valid": true + }, + { + "description": "Valid - 30 September 2023", + "data": "20230930", + "valid": true + }, + { + "description": "Valid - 31 October 2023", + "data": "20231031", + "valid": true + }, + { + "description": "Valid - 30 November 2023", + "data": "20231130", + "valid": true + }, + { + "description": "Invalid - missing hyphen (extended format)", + "data": "1985-04-12", + "valid": false + }, + { + "description": "Invalid - month 00", + "data": "19850012", + "valid": false + }, + { + "description": "Invalid - month 13", + "data": "19851312", + "valid": false + }, + { + "description": "Invalid - day 00", + "data": "19850400", + "valid": false + }, + { + "description": "Invalid - day 32", + "data": "19850432", + "valid": false + }, + { + "description": "Invalid - too few digits", + "data": "1985041", + "valid": false + }, + { + "description": "Invalid - too many digits", + "data": "198504122", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid - spaces in date", + "data": "1985 04 12", + "valid": false + }, + { + "description": "Invalid - letters in year", + "data": "ABCD0412", + "valid": false + }, + { + "description": "Invalid - letters in month", + "data": "1985AB12", + "valid": false + }, + { + "description": "Invalid - letters in day", + "data": "198504AB", + "valid": false + }, + { + "description": "Invalid - negative year (requires expanded format)", + "data": "-0011231", + "valid": false + }, + { + "description": "Invalid - plus sign (requires expanded format)", + "data": "+0011231", + "valid": false + }, + { + "description": "Invalid - 30 February (any year)", + "data": "20230230", + "valid": false + }, + { + "description": "Invalid - 31 February (any year)", + "data": "20230231", + "valid": false + }, + { + "description": "Invalid - 31 April", + "data": "20230431", + "valid": false + }, + { + "description": "Invalid - 31 June", + "data": "20230631", + "valid": false + }, + { + "description": "Invalid - 31 September", + "data": "20230931", + "valid": false + }, + { + "description": "Invalid - 31 November", + "data": "20231131", + "valid": false + }, + { + "description": "Invalid - 32 January", + "data": "20230132", + "valid": false + }, + { + "description": "Invalid - 32 March", + "data": "20230332", + "valid": false + }, + { + "description": "Invalid - 32 May", + "data": "20230532", + "valid": false + }, + { + "description": "Invalid - 32 July", + "data": "20230732", + "valid": false + }, + { + "description": "Invalid - 32 August", + "data": "20230832", + "valid": false + }, + { + "description": "Invalid - 32 October", + "data": "20231032", + "valid": false + }, + { + "description": "Invalid - 32 December", + "data": "20231232", + "valid": false + }, + { + "description": "Valid - 29 February (leap year validation is consumer responsibility)", + "data": "20230229", + "valid": true + }, + { + "description": "Valid - 28 February", + "data": "21000228", + "valid": true + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-century.test.json b/test/iso/datetime/2019/date-calendar-century.test.json new file mode 100644 index 00000000..d36e21ac --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-century.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-century.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 19, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - century 19 (20th century)", + "data": "19", + "valid": true + }, + { + "description": "Valid - century 20 (21st century)", + "data": "20", + "valid": true + }, + { + "description": "Valid - century 00", + "data": "00", + "valid": true + }, + { + "description": "Valid - century 99", + "data": "99", + "valid": true + }, + { + "description": "Invalid - single digit", + "data": "1", + "valid": false + }, + { + "description": "Invalid - three digits", + "data": "198", + "valid": false + }, + { + "description": "Invalid - with hyphen", + "data": "19-", + "valid": false + }, + { + "description": "Invalid - negative sign (requires expanded format)", + "data": "-19", + "valid": false + }, + { + "description": "Invalid - plus sign (requires expanded format)", + "data": "+19", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-decade.test.json b/test/iso/datetime/2019/date-calendar-decade.test.json new file mode 100644 index 00000000..cba9d78d --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-decade.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-decade.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 198, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - decade 198 (1980s)", + "data": "198", + "valid": true + }, + { + "description": "Valid - decade 200 (2000s)", + "data": "200", + "valid": true + }, + { + "description": "Valid - decade 202 (2020s)", + "data": "202", + "valid": true + }, + { + "description": "Valid - decade 000", + "data": "000", + "valid": true + }, + { + "description": "Valid - decade 999", + "data": "999", + "valid": true + }, + { + "description": "Invalid - two digits", + "data": "19", + "valid": false + }, + { + "description": "Invalid - four digits", + "data": "1985", + "valid": false + }, + { + "description": "Invalid - with hyphen", + "data": "198-", + "valid": false + }, + { + "description": "Invalid - negative sign (requires expanded format)", + "data": "-198", + "valid": false + }, + { + "description": "Invalid - plus sign (requires expanded format)", + "data": "+198", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-expanded-basic.test.json b/test/iso/datetime/2019/date-calendar-expanded-basic.test.json new file mode 100644 index 00000000..1d8516cc --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-expanded-basic.test.json @@ -0,0 +1,151 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-expanded-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 19850412, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - April 12, 1985 with positive sign", + "data": "+0019850412", + "valid": true + }, + { + "description": "Valid - January 1, year 1 BCE with negative sign", + "data": "-0000010101", + "valid": true + }, + { + "description": "Valid - December 31, year 999999 with positive sign", + "data": "+9999991231", + "valid": true + }, + { + "description": "Valid - January 1, year 0 with positive sign", + "data": "+0000000101", + "valid": true + }, + { + "description": "Valid - January 1, year 10000 BCE with negative sign", + "data": "-0100000101", + "valid": true + }, + { + "description": "Valid - February 29, leap year 2000", + "data": "+0020000229", + "valid": true + }, + { + "description": "Invalid - month 00", + "data": "+0019850012", + "valid": false + }, + { + "description": "Invalid - month 13", + "data": "+0019851312", + "valid": false + }, + { + "description": "Invalid - day 00", + "data": "+0019850400", + "valid": false + }, + { + "description": "Invalid - day 32", + "data": "+0019850432", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "0019850412", + "valid": false + }, + { + "description": "Invalid - five digit year", + "data": "+001985041", + "valid": false + }, + { + "description": "Invalid - seven digit year", + "data": "+00198504122", + "valid": false + }, + { + "description": "Invalid - extended format (with hyphens)", + "data": "+001985-04-12", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid - 30 February (any year)", + "data": "+0020230230", + "valid": false + }, + { + "description": "Invalid - 31 February (any year)", + "data": "+0020230231", + "valid": false + }, + { + "description": "Invalid - 31 April", + "data": "+0020230431", + "valid": false + }, + { + "description": "Invalid - 31 June", + "data": "+0020230631", + "valid": false + }, + { + "description": "Invalid - 31 September", + "data": "+0020230931", + "valid": false + }, + { + "description": "Invalid - 31 November", + "data": "+0020231131", + "valid": false + }, + { + "description": "Valid - 30 April 2023", + "data": "+0020230430", + "valid": true + }, + { + "description": "Valid - 29 February (leap year validation is consumer responsibility)", + "data": "+0024000229", + "valid": true + }, + { + "description": "Valid - 28 February", + "data": "+0021000228", + "valid": true + }, + { + "description": "Invalid - 30 February with negative year", + "data": "-0020230230", + "valid": false + }, + { + "description": "Invalid - 31 April with negative year", + "data": "-0020230431", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-expanded-century.test.json b/test/iso/datetime/2019/date-calendar-expanded-century.test.json new file mode 100644 index 00000000..b20a242b --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-expanded-century.test.json @@ -0,0 +1,66 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-expanded-century.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 19, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - century 19 (20th century) with positive sign", + "data": "+0019", + "valid": true + }, + { + "description": "Valid - century 0 BCE with negative sign", + "data": "-0000", + "valid": true + }, + { + "description": "Valid - century 9999 with positive sign", + "data": "+9999", + "valid": true + }, + { + "description": "Valid - century 0 with positive sign", + "data": "+0000", + "valid": true + }, + { + "description": "Valid - century 100 BCE with negative sign", + "data": "-0100", + "valid": true + }, + { + "description": "Invalid - missing sign", + "data": "0019", + "valid": false + }, + { + "description": "Invalid - three digits", + "data": "+001", + "valid": false + }, + { + "description": "Invalid - five digits", + "data": "+00198", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-expanded-decade.test.json b/test/iso/datetime/2019/date-calendar-expanded-decade.test.json new file mode 100644 index 00000000..769f95c3 --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-expanded-decade.test.json @@ -0,0 +1,66 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-expanded-decade.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 198, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - decade 198 (1980s) with positive sign", + "data": "+00198", + "valid": true + }, + { + "description": "Valid - decade 0 BCE with negative sign", + "data": "-00000", + "valid": true + }, + { + "description": "Valid - decade 99999 with positive sign", + "data": "+99999", + "valid": true + }, + { + "description": "Valid - decade 0 with positive sign", + "data": "+00000", + "valid": true + }, + { + "description": "Valid - decade 1000 BCE with negative sign", + "data": "-01000", + "valid": true + }, + { + "description": "Invalid - missing sign", + "data": "00198", + "valid": false + }, + { + "description": "Invalid - four digits", + "data": "+0019", + "valid": false + }, + { + "description": "Invalid - six digits", + "data": "+001985", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-expanded-extended.test.json b/test/iso/datetime/2019/date-calendar-expanded-extended.test.json new file mode 100644 index 00000000..0643a211 --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-expanded-extended.test.json @@ -0,0 +1,151 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-expanded-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 19850412, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - April 12, 1985 with positive sign", + "data": "+001985-04-12", + "valid": true + }, + { + "description": "Valid - January 1, year 1 BCE with negative sign", + "data": "-000001-01-01", + "valid": true + }, + { + "description": "Valid - December 31, year 999999 with positive sign", + "data": "+999999-12-31", + "valid": true + }, + { + "description": "Valid - January 1, year 0 with positive sign", + "data": "+000000-01-01", + "valid": true + }, + { + "description": "Valid - January 1, year 10000 BCE with negative sign", + "data": "-010000-01-01", + "valid": true + }, + { + "description": "Valid - February 29, leap year 2000", + "data": "+002000-02-29", + "valid": true + }, + { + "description": "Invalid - month 00", + "data": "+001985-00-12", + "valid": false + }, + { + "description": "Invalid - month 13", + "data": "+001985-13-12", + "valid": false + }, + { + "description": "Invalid - day 00", + "data": "+001985-04-00", + "valid": false + }, + { + "description": "Invalid - day 32", + "data": "+001985-04-32", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985-04-12", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphens)", + "data": "+0019850412", + "valid": false + }, + { + "description": "Invalid - missing first hyphen", + "data": "+00198504-12", + "valid": false + }, + { + "description": "Invalid - missing second hyphen", + "data": "+001985-0412", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid - 30 February (any year)", + "data": "+002023-02-30", + "valid": false + }, + { + "description": "Invalid - 31 February (any year)", + "data": "+002023-02-31", + "valid": false + }, + { + "description": "Invalid - 31 April", + "data": "+002023-04-31", + "valid": false + }, + { + "description": "Invalid - 31 June", + "data": "+002023-06-31", + "valid": false + }, + { + "description": "Invalid - 31 September", + "data": "+002023-09-31", + "valid": false + }, + { + "description": "Invalid - 31 November", + "data": "+002023-11-31", + "valid": false + }, + { + "description": "Valid - 30 April 2023", + "data": "+002023-04-30", + "valid": true + }, + { + "description": "Valid - 29 February (leap year validation is consumer responsibility)", + "data": "+002400-02-29", + "valid": true + }, + { + "description": "Valid - 28 February", + "data": "+002100-02-28", + "valid": true + }, + { + "description": "Invalid - 30 February with negative year", + "data": "-002023-02-30", + "valid": false + }, + { + "description": "Invalid - 31 April with negative year", + "data": "-002023-04-31", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-expanded-month.test.json b/test/iso/datetime/2019/date-calendar-expanded-month.test.json new file mode 100644 index 00000000..d9dc0af3 --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-expanded-month.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-expanded-month.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 198504, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - April 1985 with positive sign", + "data": "+001985-04", + "valid": true + }, + { + "description": "Valid - January year 1 BCE with negative sign", + "data": "-000001-01", + "valid": true + }, + { + "description": "Valid - December year 999999 with positive sign", + "data": "+999999-12", + "valid": true + }, + { + "description": "Valid - January year 0 with positive sign", + "data": "+000000-01", + "valid": true + }, + { + "description": "Valid - December year 10000 BCE with negative sign", + "data": "-010000-12", + "valid": true + }, + { + "description": "Invalid - month 00", + "data": "+001985-00", + "valid": false + }, + { + "description": "Invalid - month 13", + "data": "+001985-13", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985-04", + "valid": false + }, + { + "description": "Invalid - with day component", + "data": "+001985-04-12", + "valid": false + }, + { + "description": "Invalid - missing hyphen", + "data": "+00198504", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-expanded-year.test.json b/test/iso/datetime/2019/date-calendar-expanded-year.test.json new file mode 100644 index 00000000..d3152499 --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-expanded-year.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-expanded-year.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - year 1985 with positive sign", + "data": "+001985", + "valid": true + }, + { + "description": "Valid - year 1 BCE with negative sign", + "data": "-000001", + "valid": true + }, + { + "description": "Valid - year 999999 with positive sign", + "data": "+999999", + "valid": true + }, + { + "description": "Valid - year 0 with positive sign", + "data": "+000000", + "valid": true + }, + { + "description": "Valid - year 10000 BCE with negative sign", + "data": "-010000", + "valid": true + }, + { + "description": "Invalid - missing sign", + "data": "001985", + "valid": false + }, + { + "description": "Invalid - five digits", + "data": "+00198", + "valid": false + }, + { + "description": "Invalid - seven digits", + "data": "+0019850", + "valid": false + }, + { + "description": "Invalid - with month component", + "data": "+001985-04", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-extended.test.json b/test/iso/datetime/2019/date-calendar-extended.test.json new file mode 100644 index 00000000..7cc2014e --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-extended.test.json @@ -0,0 +1,246 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 19850412, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + }, + { + "description": "Valid - 12 April 1985", + "data": "1985-04-12", + "valid": true + }, + { + "description": "Valid - 1 January 2000", + "data": "2000-01-01", + "valid": true + }, + { + "description": "Valid - 31 December 2023", + "data": "2023-12-31", + "valid": true + }, + { + "description": "Valid - 1 January year 0000", + "data": "0000-01-01", + "valid": true + }, + { + "description": "Valid - 31 December year 9999", + "data": "9999-12-31", + "valid": true + }, + { + "description": "Valid - 29 February 2000 (leap year)", + "data": "2000-02-29", + "valid": true + }, + { + "description": "Valid - 29 February 2004 (leap year)", + "data": "2004-02-29", + "valid": true + }, + { + "description": "Valid - 28 February 2001 (non-leap year)", + "data": "2001-02-28", + "valid": true + }, + { + "description": "Invalid - basic format (no hyphens)", + "data": "19850412", + "valid": false + }, + { + "description": "Invalid - month 00", + "data": "1985-00-12", + "valid": false + }, + { + "description": "Invalid - month 13", + "data": "1985-13-12", + "valid": false + }, + { + "description": "Invalid - day 00", + "data": "1985-04-00", + "valid": false + }, + { + "description": "Invalid - day 32", + "data": "1985-04-32", + "valid": false + }, + { + "description": "Invalid - missing first hyphen", + "data": "198504-12", + "valid": false + }, + { + "description": "Invalid - missing second hyphen", + "data": "1985-0412", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid - spaces instead of hyphens", + "data": "1985 04 12", + "valid": false + }, + { + "description": "Invalid - 30 February (any year)", + "data": "2023-02-30", + "valid": false + }, + { + "description": "Invalid - 31 February (any year)", + "data": "2023-02-31", + "valid": false + }, + { + "description": "Invalid - 31 April", + "data": "2023-04-31", + "valid": false + }, + { + "description": "Invalid - 31 June", + "data": "2023-06-31", + "valid": false + }, + { + "description": "Invalid - 31 September", + "data": "2023-09-31", + "valid": false + }, + { + "description": "Invalid - 31 November", + "data": "2023-11-31", + "valid": false + }, + { + "description": "Invalid - 32 January", + "data": "2023-01-32", + "valid": false + }, + { + "description": "Invalid - 32 March", + "data": "2023-03-32", + "valid": false + }, + { + "description": "Invalid - 32 May", + "data": "2023-05-32", + "valid": false + }, + { + "description": "Invalid - 32 July", + "data": "2023-07-32", + "valid": false + }, + { + "description": "Invalid - 32 August", + "data": "2023-08-32", + "valid": false + }, + { + "description": "Invalid - 32 October", + "data": "2023-10-32", + "valid": false + }, + { + "description": "Invalid - 32 December", + "data": "2023-12-32", + "valid": false + }, + { + "description": "Valid - 29 February (leap year validation is consumer responsibility)", + "data": "2400-02-29", + "valid": true + }, + { + "description": "Valid - 28 February", + "data": "2100-02-28", + "valid": true + }, + { + "description": "Valid - 30 April 2023", + "data": "2023-04-30", + "valid": true + }, + { + "description": "Valid - 30 June 2023", + "data": "2023-06-30", + "valid": true + }, + { + "description": "Valid - 30 September 2023", + "data": "2023-09-30", + "valid": true + }, + { + "description": "Valid - 30 November 2023", + "data": "2023-11-30", + "valid": true + }, + { + "description": "Valid - 31 January 2023", + "data": "2023-01-31", + "valid": true + }, + { + "description": "Valid - 31 March 2023", + "data": "2023-03-31", + "valid": true + }, + { + "description": "Valid - 31 May 2023", + "data": "2023-05-31", + "valid": true + }, + { + "description": "Valid - 31 July 2023", + "data": "2023-07-31", + "valid": true + }, + { + "description": "Valid - 31 August 2023", + "data": "2023-08-31", + "valid": true + }, + { + "description": "Valid - 31 October 2023", + "data": "2023-10-31", + "valid": true + }, + { + "description": "Valid - 31 December 2023", + "data": "2023-12-31", + "valid": true + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-month.test.json b/test/iso/datetime/2019/date-calendar-month.test.json new file mode 100644 index 00000000..a8991028 --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-month.test.json @@ -0,0 +1,71 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-month.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 198504, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - April 1985", + "data": "1985-04", + "valid": true + }, + { + "description": "Valid - January 2000", + "data": "2000-01", + "valid": true + }, + { + "description": "Valid - December 2023", + "data": "2023-12", + "valid": true + }, + { + "description": "Valid - January year 0000", + "data": "0000-01", + "valid": true + }, + { + "description": "Valid - December year 9999", + "data": "9999-12", + "valid": true + }, + { + "description": "Invalid - month 00", + "data": "1985-00", + "valid": false + }, + { + "description": "Invalid - month 13", + "data": "1985-13", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphen)", + "data": "198504", + "valid": false + }, + { + "description": "Invalid - with day component", + "data": "1985-04-12", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-calendar-year.test.json b/test/iso/datetime/2019/date-calendar-year.test.json new file mode 100644 index 00000000..1eca1a73 --- /dev/null +++ b/test/iso/datetime/2019/date-calendar-year.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-calendar-year.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - year 1985", + "data": "1985", + "valid": true + }, + { + "description": "Valid - year 2000", + "data": "2000", + "valid": true + }, + { + "description": "Valid - year 2023", + "data": "2023", + "valid": true + }, + { + "description": "Valid - year 0000", + "data": "0000", + "valid": true + }, + { + "description": "Valid - year 9999", + "data": "9999", + "valid": true + }, + { + "description": "Invalid - three digits", + "data": "198", + "valid": false + }, + { + "description": "Invalid - five digits", + "data": "19850", + "valid": false + }, + { + "description": "Invalid - with month component", + "data": "1985-04", + "valid": false + }, + { + "description": "Invalid - negative sign (requires expanded format)", + "data": "-1985", + "valid": false + }, + { + "description": "Invalid - plus sign (requires expanded format)", + "data": "+1985", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-ordinal-basic.test.json b/test/iso/datetime/2019/date-ordinal-basic.test.json new file mode 100644 index 00000000..a11fbcb2 --- /dev/null +++ b/test/iso/datetime/2019/date-ordinal-basic.test.json @@ -0,0 +1,191 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-ordinal-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985102, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - 102nd day of 1985", + "data": "1985102", + "valid": true + }, + { + "description": "Valid - 1st day of 2000", + "data": "2000001", + "valid": true + }, + { + "description": "Valid - 366th day of 2000 (leap year)", + "data": "2000366", + "valid": true + }, + { + "description": "Valid - 365th day of 2023 (non-leap year)", + "data": "2023365", + "valid": true + }, + { + "description": "Valid - 1st day of year 0000", + "data": "0000001", + "valid": true + }, + { + "description": "Valid - 365th day of year 9999", + "data": "9999365", + "valid": true + }, + { + "description": "Valid - 60th day of 2004 (29 Feb in leap year)", + "data": "2004060", + "valid": true + }, + { + "description": "Valid - 59th day of 2003 (28 Feb in non-leap year)", + "data": "2003059", + "valid": true + }, + { + "description": "Valid - 180th day (around end of June)", + "data": "2023180", + "valid": true + }, + { + "description": "Valid - 270th day (around end of September)", + "data": "2023270", + "valid": true + }, + { + "description": "Invalid - day 000", + "data": "1985000", + "valid": false + }, + { + "description": "Invalid - day 367", + "data": "1985367", + "valid": false + }, + { + "description": "Invalid - day 999", + "data": "1985999", + "valid": false + }, + { + "description": "Invalid - extended format (with hyphen)", + "data": "1985-102", + "valid": false + }, + { + "description": "Invalid - too few digits", + "data": "198510", + "valid": false + }, + { + "description": "Invalid - too many digits", + "data": "19851022", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid - spaces in date", + "data": "1985 102", + "valid": false + }, + { + "description": "Invalid - letters in ordinal day", + "data": "1985ABC", + "valid": false + }, + { + "description": "Valid - 366th day of 2004 (leap year)", + "data": "2004366", + "valid": true + }, + { + "description": "Valid - 366th day of 2400 (leap year, divisible by 400)", + "data": "2400366", + "valid": true + }, + { + "description": "Valid - 365th day of 2100 (non-leap year, century exception)", + "data": "2100365", + "valid": true + }, + { + "description": "Valid - Day 001 (January 1st)", + "data": "2023001", + "valid": true + }, + { + "description": "Valid - Day 032 (February 1st in non-leap year)", + "data": "2023032", + "valid": true + }, + { + "description": "Valid - Day 060 (March 1st in leap year)", + "data": "2000060", + "valid": true + }, + { + "description": "Valid - Day 091 (April 1st in non-leap year)", + "data": "2023091", + "valid": true + }, + { + "description": "Invalid - Day 368", + "data": "2023368", + "valid": false + }, + { + "description": "Invalid - Day 400", + "data": "2023400", + "valid": false + }, + { + "description": "Invalid - Day 500", + "data": "2023500", + "valid": false + }, + { + "description": "Invalid - Missing leading zeros (day 1)", + "data": "20231", + "valid": false + }, + { + "description": "Invalid - Missing leading zeros (day 01)", + "data": "202301", + "valid": false + }, + { + "description": "Invalid - Missing leading zeros (day 10)", + "data": "202310", + "valid": false + }, + { + "description": "Invalid - negative year (requires expanded format)", + "data": "-0001001", + "valid": false + }, + { + "description": "Invalid - plus sign (requires expanded format)", + "data": "+0001001", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-ordinal-expanded-basic.test.json b/test/iso/datetime/2019/date-ordinal-expanded-basic.test.json new file mode 100644 index 00000000..f649775a --- /dev/null +++ b/test/iso/datetime/2019/date-ordinal-expanded-basic.test.json @@ -0,0 +1,116 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-ordinal-expanded-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985102, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - day 102 of 1985 with positive sign", + "data": "+001985102", + "valid": true + }, + { + "description": "Valid - day 1 of year 1 BCE with negative sign", + "data": "-000001001", + "valid": true + }, + { + "description": "Valid - day 366 of year 999999 with positive sign", + "data": "+999999366", + "valid": true + }, + { + "description": "Valid - day 1 of year 0 with positive sign", + "data": "+000000001", + "valid": true + }, + { + "description": "Valid - day 365 of year 10000 BCE with negative sign", + "data": "-010000365", + "valid": true + }, + { + "description": "Valid - day 001 (first day)", + "data": "+001985001", + "valid": true + }, + { + "description": "Valid - day 200", + "data": "+001985200", + "valid": true + }, + { + "description": "Valid - day 299", + "data": "+001985299", + "valid": true + }, + { + "description": "Invalid - day 000", + "data": "+001985000", + "valid": false + }, + { + "description": "Invalid - day 367", + "data": "+001985367", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985102", + "valid": false + }, + { + "description": "Invalid - extended format (with hyphen)", + "data": "+001985-102", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Valid - 366th day of leap year 2004", + "data": "+002004366", + "valid": true + }, + { + "description": "Valid - 365th day of non-leap year 2100", + "data": "+002100365", + "valid": true + }, + { + "description": "Invalid - Day 368", + "data": "+002023368", + "valid": false + }, + { + "description": "Invalid - Day 400", + "data": "+002023400", + "valid": false + }, + { + "description": "Invalid - Day 500 with negative year", + "data": "-002023500", + "valid": false + }, + { + "description": "Invalid - Day 999", + "data": "+002023999", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-ordinal-expanded-extended.test.json b/test/iso/datetime/2019/date-ordinal-expanded-extended.test.json new file mode 100644 index 00000000..f3994bb4 --- /dev/null +++ b/test/iso/datetime/2019/date-ordinal-expanded-extended.test.json @@ -0,0 +1,116 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-ordinal-expanded-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985102, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - day 102 of 1985 with positive sign", + "data": "+001985-102", + "valid": true + }, + { + "description": "Valid - day 1 of year 1 BCE with negative sign", + "data": "-000001-001", + "valid": true + }, + { + "description": "Valid - day 366 of year 999999 with positive sign", + "data": "+999999-366", + "valid": true + }, + { + "description": "Valid - day 1 of year 0 with positive sign", + "data": "+000000-001", + "valid": true + }, + { + "description": "Valid - day 365 of year 10000 BCE with negative sign", + "data": "-010000-365", + "valid": true + }, + { + "description": "Valid - day 001 (first day)", + "data": "+001985-001", + "valid": true + }, + { + "description": "Valid - day 200", + "data": "+001985-200", + "valid": true + }, + { + "description": "Valid - day 299", + "data": "+001985-299", + "valid": true + }, + { + "description": "Invalid - day 000", + "data": "+001985-000", + "valid": false + }, + { + "description": "Invalid - day 367", + "data": "+001985-367", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985-102", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphen)", + "data": "+001985102", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Valid - 366th day of leap year 2004", + "data": "+002004-366", + "valid": true + }, + { + "description": "Valid - 365th day of non-leap year 2100", + "data": "+002100-365", + "valid": true + }, + { + "description": "Invalid - Day 368", + "data": "+002023-368", + "valid": false + }, + { + "description": "Invalid - Day 400", + "data": "+002023-400", + "valid": false + }, + { + "description": "Invalid - Day 500 with negative year", + "data": "-002023-500", + "valid": false + }, + { + "description": "Invalid - Day 999", + "data": "+002023-999", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-ordinal-extended.test.json b/test/iso/datetime/2019/date-ordinal-extended.test.json new file mode 100644 index 00000000..6c01a364 --- /dev/null +++ b/test/iso/datetime/2019/date-ordinal-extended.test.json @@ -0,0 +1,131 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-ordinal-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985102, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - 102nd day of 1985", + "data": "1985-102", + "valid": true + }, + { + "description": "Valid - 1st day of 2000", + "data": "2000-001", + "valid": true + }, + { + "description": "Valid - 366th day of 2000 (leap year)", + "data": "2000-366", + "valid": true + }, + { + "description": "Valid - 365th day of 2023 (non-leap year)", + "data": "2023-365", + "valid": true + }, + { + "description": "Valid - 1st day of year 0000", + "data": "0000-001", + "valid": true + }, + { + "description": "Invalid - day 000", + "data": "1985-000", + "valid": false + }, + { + "description": "Invalid - day 367", + "data": "1985-367", + "valid": false + }, + { + "description": "Invalid - day 999", + "data": "1985-999", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphen)", + "data": "1985102", + "valid": false + }, + { + "description": "Invalid - missing hyphen", + "data": "1985102", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Valid - 366th day of 2004 (leap year)", + "data": "2004-366", + "valid": true + }, + { + "description": "Valid - 366th day of 2400 (leap year, divisible by 400)", + "data": "2400-366", + "valid": true + }, + { + "description": "Valid - 365th day of 2100 (non-leap year, century exception)", + "data": "2100-365", + "valid": true + }, + { + "description": "Valid - Day 032 (February 1st in non-leap year)", + "data": "2023-032", + "valid": true + }, + { + "description": "Valid - Day 060 (March 1st in leap year)", + "data": "2000-060", + "valid": true + }, + { + "description": "Invalid - Day 368", + "data": "2023-368", + "valid": false + }, + { + "description": "Invalid - Day 400", + "data": "2023-400", + "valid": false + }, + { + "description": "Invalid - Day 500", + "data": "2023-500", + "valid": false + }, + { + "description": "Invalid - Missing leading zeros (day 1)", + "data": "2023-1", + "valid": false + }, + { + "description": "Invalid - Missing leading zeros (day 01)", + "data": "2023-01", + "valid": false + }, + { + "description": "Invalid - Missing leading zeros (day 10)", + "data": "2023-10", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-basic.test.json b/test/iso/datetime/2019/date-week-basic.test.json new file mode 100644 index 00000000..e5d8a84f --- /dev/null +++ b/test/iso/datetime/2019/date-week-basic.test.json @@ -0,0 +1,186 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - Friday of week 15, 1985 (day 5)", + "data": "1985W155", + "valid": true + }, + { + "description": "Valid - Monday of week 1, 2000 (day 1)", + "data": "2000W011", + "valid": true + }, + { + "description": "Valid - Sunday of week 52, 2023 (day 7)", + "data": "2023W527", + "valid": true + }, + { + "description": "Valid - Monday of week 1, year 0000 (day 1)", + "data": "0000W011", + "valid": true + }, + { + "description": "Valid - Sunday of week 53, year 9999 (day 7)", + "data": "9999W537", + "valid": true + }, + { + "description": "Valid - Tuesday of week 26, 2023 (day 2)", + "data": "2023W262", + "valid": true + }, + { + "description": "Valid - Wednesday of week 1, 2023 (day 3)", + "data": "2023W013", + "valid": true + }, + { + "description": "Valid - Thursday of week 40, 2023 (day 4)", + "data": "2023W404", + "valid": true + }, + { + "description": "Valid - Friday of week 10, 2023 (day 5)", + "data": "2023W105", + "valid": true + }, + { + "description": "Valid - Saturday of week 30, 2023 (day 6)", + "data": "2023W306", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "1985W005", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "1985W545", + "valid": false + }, + { + "description": "Invalid - day 0", + "data": "1985W150", + "valid": false + }, + { + "description": "Invalid - day 8", + "data": "1985W158", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "1985155", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "1985w155", + "valid": false + }, + { + "description": "Invalid - extended format (with hyphens)", + "data": "1985-W15-5", + "valid": false + }, + { + "description": "Invalid - too few digits", + "data": "1985W15", + "valid": false + }, + { + "description": "Invalid - too many digits", + "data": "1985W1555", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Invalid - spaces in date", + "data": "1985 W15 5", + "valid": false + }, + { + "description": "Valid - Week 53 day 1 (years with 53 weeks exist)", + "data": "2020W531", + "valid": true + }, + { + "description": "Valid - Week 53 day 7", + "data": "2015W537", + "valid": true + }, + { + "description": "Valid - Week 01 day 1", + "data": "2023W011", + "valid": true + }, + { + "description": "Valid - Week 52 day 7", + "data": "2022W527", + "valid": true + }, + { + "description": "Invalid - Week 54 day 1", + "data": "2023W541", + "valid": false + }, + { + "description": "Invalid - Week 55 day 1", + "data": "2023W551", + "valid": false + }, + { + "description": "Invalid - Week 99 day 1", + "data": "2023W991", + "valid": false + }, + { + "description": "Invalid - Week 01 day 0", + "data": "2023W010", + "valid": false + }, + { + "description": "Invalid - Week 01 day 9", + "data": "2023W019", + "valid": false + }, + { + "description": "Invalid - Missing leading zero in week (W1)", + "data": "2023W15", + "valid": false + }, + { + "description": "Invalid - negative year (requires expanded format)", + "data": "-001W011", + "valid": false + }, + { + "description": "Invalid - plus sign (requires expanded format)", + "data": "+001W011", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-expanded-basic.test.json b/test/iso/datetime/2019/date-week-expanded-basic.test.json new file mode 100644 index 00000000..483039a4 --- /dev/null +++ b/test/iso/datetime/2019/date-week-expanded-basic.test.json @@ -0,0 +1,91 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-expanded-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - Friday (day 5) of week 15, 1985 with positive sign", + "data": "+001985W155", + "valid": true + }, + { + "description": "Valid - Monday (day 1) of week 1, year 1 BCE with negative sign", + "data": "-000001W011", + "valid": true + }, + { + "description": "Valid - Sunday (day 7) of week 53, year 999999 with positive sign", + "data": "+999999W537", + "valid": true + }, + { + "description": "Valid - Monday (day 1) of week 1, year 0 with positive sign", + "data": "+000000W011", + "valid": true + }, + { + "description": "Valid - Sunday (day 7) of week 52, year 10000 BCE with negative sign", + "data": "-010000W527", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "+001985W005", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "+001985W545", + "valid": false + }, + { + "description": "Invalid - day 0", + "data": "+001985W150", + "valid": false + }, + { + "description": "Invalid - day 8", + "data": "+001985W158", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985W155", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "+001985155", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "+001985w155", + "valid": false + }, + { + "description": "Invalid - extended format (with hyphens)", + "data": "+001985-W15-5", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-expanded-extended.test.json b/test/iso/datetime/2019/date-week-expanded-extended.test.json new file mode 100644 index 00000000..a34d7fe1 --- /dev/null +++ b/test/iso/datetime/2019/date-week-expanded-extended.test.json @@ -0,0 +1,101 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-expanded-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - Friday (day 5) of week 15, 1985 with positive sign", + "data": "+001985-W15-5", + "valid": true + }, + { + "description": "Valid - Monday (day 1) of week 1, year 1 BCE with negative sign", + "data": "-000001-W01-1", + "valid": true + }, + { + "description": "Valid - Sunday (day 7) of week 53, year 999999 with positive sign", + "data": "+999999-W53-7", + "valid": true + }, + { + "description": "Valid - Monday (day 1) of week 1, year 0 with positive sign", + "data": "+000000-W01-1", + "valid": true + }, + { + "description": "Valid - Sunday (day 7) of week 52, year 10000 BCE with negative sign", + "data": "-010000-W52-7", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "+001985-W00-5", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "+001985-W54-5", + "valid": false + }, + { + "description": "Invalid - day 0", + "data": "+001985-W15-0", + "valid": false + }, + { + "description": "Invalid - day 8", + "data": "+001985-W15-8", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985-W15-5", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "+001985-15-5", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "+001985-w15-5", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphens)", + "data": "+001985W155", + "valid": false + }, + { + "description": "Invalid - missing first hyphen", + "data": "+001985W15-5", + "valid": false + }, + { + "description": "Invalid - missing second hyphen", + "data": "+001985-W155", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-expanded-reduced-basic.test.json b/test/iso/datetime/2019/date-week-expanded-reduced-basic.test.json new file mode 100644 index 00000000..1d157d76 --- /dev/null +++ b/test/iso/datetime/2019/date-week-expanded-reduced-basic.test.json @@ -0,0 +1,86 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-expanded-reduced-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - week 15 of 1985 with positive sign", + "data": "+001985W15", + "valid": true + }, + { + "description": "Valid - week 1 of year 1 BCE with negative sign", + "data": "-000001W01", + "valid": true + }, + { + "description": "Valid - week 53 of year 999999 with positive sign", + "data": "+999999W53", + "valid": true + }, + { + "description": "Valid - week 1 of year 0 with positive sign", + "data": "+000000W01", + "valid": true + }, + { + "description": "Valid - week 52 of year 10000 BCE with negative sign", + "data": "-010000W52", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "+001985W00", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "+001985W54", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985W15", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "+00198515", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "+001985w15", + "valid": false + }, + { + "description": "Invalid - extended format (with hyphen)", + "data": "+001985-W15", + "valid": false + }, + { + "description": "Invalid - with day component", + "data": "+001985W155", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-expanded-reduced-extended.test.json b/test/iso/datetime/2019/date-week-expanded-reduced-extended.test.json new file mode 100644 index 00000000..292d44d3 --- /dev/null +++ b/test/iso/datetime/2019/date-week-expanded-reduced-extended.test.json @@ -0,0 +1,86 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-expanded-reduced-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - week 15 of 1985 with positive sign", + "data": "+001985-W15", + "valid": true + }, + { + "description": "Valid - week 1 of year 1 BCE with negative sign", + "data": "-000001-W01", + "valid": true + }, + { + "description": "Valid - week 53 of year 999999 with positive sign", + "data": "+999999-W53", + "valid": true + }, + { + "description": "Valid - week 1 of year 0 with positive sign", + "data": "+000000-W01", + "valid": true + }, + { + "description": "Valid - week 52 of year 10000 BCE with negative sign", + "data": "-010000-W52", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "+001985-W00", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "+001985-W54", + "valid": false + }, + { + "description": "Invalid - missing sign", + "data": "001985-W15", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "+001985-15", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "+001985-w15", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphen)", + "data": "+001985W15", + "valid": false + }, + { + "description": "Invalid - with day component", + "data": "+001985-W15-5", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-extended.test.json b/test/iso/datetime/2019/date-week-extended.test.json new file mode 100644 index 00000000..399e5657 --- /dev/null +++ b/test/iso/datetime/2019/date-week-extended.test.json @@ -0,0 +1,126 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - Friday of week 15, 1985 (day 5)", + "data": "1985-W15-5", + "valid": true + }, + { + "description": "Valid - Monday of week 1, 2000 (day 1)", + "data": "2000-W01-1", + "valid": true + }, + { + "description": "Valid - Sunday of week 52, 2023 (day 7)", + "data": "2023-W52-7", + "valid": true + }, + { + "description": "Valid - Monday of week 1, year 0000 (day 1)", + "data": "0000-W01-1", + "valid": true + }, + { + "description": "Valid - Sunday of week 53, year 9999 (day 7)", + "data": "9999-W53-7", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "1985-W00-5", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "1985-W54-5", + "valid": false + }, + { + "description": "Invalid - day 0", + "data": "1985-W15-0", + "valid": false + }, + { + "description": "Invalid - day 8", + "data": "1985-W15-8", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "1985-15-5", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "1985-w15-5", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphens)", + "data": "1985W155", + "valid": false + }, + { + "description": "Invalid - missing first hyphen", + "data": "1985W15-5", + "valid": false + }, + { + "description": "Invalid - missing second hyphen", + "data": "1985-W155", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Valid - Week 53 day 1 (years with 53 weeks exist)", + "data": "2020-W53-1", + "valid": true + }, + { + "description": "Valid - Week 53 day 7", + "data": "2015-W53-7", + "valid": true + }, + { + "description": "Invalid - Week 54 day 1", + "data": "2023-W54-1", + "valid": false + }, + { + "description": "Invalid - Week 55 day 1", + "data": "2023-W55-1", + "valid": false + }, + { + "description": "Invalid - Week 99 day 1", + "data": "2023-W99-1", + "valid": false + }, + { + "description": "Invalid - Week 01 day 9", + "data": "2023-W01-9", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-reduced-basic.test.json b/test/iso/datetime/2019/date-week-reduced-basic.test.json new file mode 100644 index 00000000..598642ed --- /dev/null +++ b/test/iso/datetime/2019/date-week-reduced-basic.test.json @@ -0,0 +1,101 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-reduced-basic.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - week 15 of 1985", + "data": "1985W15", + "valid": true + }, + { + "description": "Valid - week 1 of 2000", + "data": "2000W01", + "valid": true + }, + { + "description": "Valid - week 52 of 2023", + "data": "2023W52", + "valid": true + }, + { + "description": "Valid - week 1 of year 0000", + "data": "0000W01", + "valid": true + }, + { + "description": "Valid - week 53 of year 9999", + "data": "9999W53", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "1985W00", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "1985W54", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "198515", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "1985w15", + "valid": false + }, + { + "description": "Invalid - extended format (with hyphen)", + "data": "1985-W15", + "valid": false + }, + { + "description": "Invalid - with day component", + "data": "1985W155", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + }, + { + "description": "Valid - Week 53 (years with 53 weeks exist)", + "data": "2020W53", + "valid": true + }, + { + "description": "Invalid - Week 54", + "data": "2023W54", + "valid": false + }, + { + "description": "Invalid - Week 55", + "data": "2023W55", + "valid": false + }, + { + "description": "Invalid - Week 99", + "data": "2023W99", + "valid": false + } + ] +} diff --git a/test/iso/datetime/2019/date-week-reduced-extended.test.json b/test/iso/datetime/2019/date-week-reduced-extended.test.json new file mode 100644 index 00000000..8be0dd7f --- /dev/null +++ b/test/iso/datetime/2019/date-week-reduced-extended.test.json @@ -0,0 +1,81 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/iso/datetime/2019/date-week-reduced-extended.json", + "tests": [ + { + "description": "Invalid type - integer", + "data": 1985155, + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Valid - week 15 of 1985", + "data": "1985-W15", + "valid": true + }, + { + "description": "Valid - week 1 of 2000", + "data": "2000-W01", + "valid": true + }, + { + "description": "Valid - week 52 of 2023", + "data": "2023-W52", + "valid": true + }, + { + "description": "Valid - week 1 of year 0000", + "data": "0000-W01", + "valid": true + }, + { + "description": "Valid - week 53 of year 9999", + "data": "9999-W53", + "valid": true + }, + { + "description": "Invalid - week 00", + "data": "1985-W00", + "valid": false + }, + { + "description": "Invalid - week 54", + "data": "1985-W54", + "valid": false + }, + { + "description": "Invalid - missing W designator", + "data": "1985-15", + "valid": false + }, + { + "description": "Invalid - lowercase w", + "data": "1985-w15", + "valid": false + }, + { + "description": "Invalid - basic format (no hyphen)", + "data": "1985W15", + "valid": false + }, + { + "description": "Invalid - with day component", + "data": "1985-W15-5", + "valid": false + }, + { + "description": "Invalid - empty string", + "data": "", + "valid": false + } + ] +}