Skip to content

Commit 08600dd

Browse files
committed
Specification
1 parent ea23b86 commit 08600dd

23 files changed

Lines changed: 714 additions & 426 deletions

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// --------------------------------------------------------------
2424
// Build
2525
// --------------------------------------------------------------
26-
"tasksmith": "https://raw.githubusercontent.com/sinclairzx81/tasksmith/0.9.9/src/index.ts",
26+
"tasksmith": "https://raw.githubusercontent.com/sinclairzx81/tasksmith/0.9.11/src/index.ts",
2727
"parsebox": "https://raw.githubusercontent.com/sinclairzx81/parsebox/0.11.3/src/index.ts",
2828
// --------------------------------------------------------------
2929
// Test

deno.lock

Lines changed: 98 additions & 315 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/jsonschema/cases/draft2019-09/minProperties.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@
4040
"description": "ignores other non-objects",
4141
"data": 12,
4242
"valid": true
43+
},
44+
{
45+
"description": "ignores null",
46+
"data": null,
47+
"valid": true
48+
},
49+
{
50+
"description": "ignores booleans",
51+
"data": true,
52+
"valid": true
4353
}
4454
]
4555
},

test/jsonschema/cases/draft2019-09/optional/format/date.json

Lines changed: 113 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@
5656
"data": "2021-02-28",
5757
"valid": true
5858
},
59-
{
60-
"description": "a invalid date string with 29 days in February (normal)",
61-
"data": "2021-02-29",
62-
"valid": false
63-
},
64-
{
65-
"description": "a valid date string with 29 days in February (leap)",
66-
"data": "2020-02-29",
67-
"valid": true
68-
},
6959
{
7060
"description": "a invalid date string with 30 days in February (leap)",
7161
"data": "2020-02-30",
@@ -171,11 +161,6 @@
171161
"data": "2020-12-32",
172162
"valid": false
173163
},
174-
{
175-
"description": "a invalid date string with invalid month",
176-
"data": "2020-13-01",
177-
"valid": false
178-
},
179164
{
180165
"description": "an invalid date string",
181166
"data": "06/19/1963",
@@ -201,11 +186,6 @@
201186
"data": "1998-13-01",
202187
"valid": false
203188
},
204-
{
205-
"description": "invalid month-day combination",
206-
"data": "1998-04-31",
207-
"valid": false
208-
},
209189
{
210190
"description": "2021 is not a leap year",
211191
"data": "2021-02-29",
@@ -245,6 +225,119 @@
245225
"description": "an invalid time string in date-time format",
246226
"data": "2020-11-28T23:55:45Z",
247227
"valid": false
228+
},
229+
{
230+
"description": "year 0000 is a leap year (0 % 400 == 0)",
231+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — year zero leap year edge case",
232+
"data": "0000-02-29",
233+
"valid": true
234+
},
235+
{
236+
"description": "century year 0100 is not a leap year",
237+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0",
238+
"data": "0100-02-29",
239+
"valid": false
240+
},
241+
{
242+
"description": "century year 0400 is a leap year",
243+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary",
244+
"data": "0400-02-29",
245+
"valid": true
246+
},
247+
{
248+
"description": "century year 2100 is not a leap year",
249+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year",
250+
"data": "2100-02-29",
251+
"valid": false
252+
},
253+
{
254+
"description": "invalid: leading whitespace is not permitted",
255+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace",
256+
"data": " 2024-01-15",
257+
"valid": false
258+
},
259+
{
260+
"description": "invalid: trailing whitespace is not permitted",
261+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace",
262+
"data": "2024-01-15 ",
263+
"valid": false
264+
},
265+
{
266+
"description": "invalid: month 00 is not valid per date-month range 01-12",
267+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12",
268+
"data": "2024-00-15",
269+
"valid": false
270+
},
271+
{
272+
"description": "invalid: day 00 is not valid per date-mday minimum of 01",
273+
"comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31",
274+
"data": "2024-01-00",
275+
"valid": false
276+
},
277+
{
278+
"description": "invalid: empty string",
279+
"data": "",
280+
"valid": false
281+
},
282+
{
283+
"description": "invalid: embedded whitespace between year and month",
284+
"data": "2020 -01-01",
285+
"valid": false
286+
},
287+
{
288+
"description": "invalid: trailing character after valid full-date",
289+
"data": "2020-01-01X",
290+
"valid": false
291+
},
292+
{
293+
"description": "invalid: trailing Z after full-date",
294+
"data": "2020-01-01Z",
295+
"valid": false
296+
},
297+
{
298+
"description": "invalid: full-date followed by space and time component",
299+
"data": "2020-01-01 00:00:00Z",
300+
"valid": false
301+
},
302+
{
303+
"description": "valid: four-digit year 0001",
304+
"data": "0001-01-01",
305+
"valid": true
306+
},
307+
{
308+
"description": "invalid: two-digit year (N-2 digits)",
309+
"data": "20-01-01",
310+
"valid": false
311+
},
312+
{
313+
"description": "invalid: three-digit year (N-1 digits)",
314+
"data": "998-01-01",
315+
"valid": false
316+
},
317+
{
318+
"description": "invalid: five-digit year (N+1 digits)",
319+
"data": "12020-01-01",
320+
"valid": false
321+
},
322+
{
323+
"description": "invalid: positive sign prefix on year",
324+
"data": "+2020-01-01",
325+
"valid": false
326+
},
327+
{
328+
"description": "invalid: negative sign prefix on year",
329+
"data": "-2020-01-01",
330+
"valid": false
331+
},
332+
{
333+
"description": "invalid: non-ASCII Bengali digit in year field",
334+
"data": "২020-01-01",
335+
"valid": false
336+
},
337+
{
338+
"description": "invalid: alphabetic characters in year field",
339+
"data": "YYYY-01-01",
340+
"valid": false
248341
}
249342
]
250343
}

test/jsonschema/cases/draft2019-09/optional/format/hostname.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,6 @@
101101
"data": "hostname-",
102102
"valid": false
103103
},
104-
{
105-
"description": "contains \"--\" in the 3rd and 4th position",
106-
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
107-
"data": "XN--aa---o47jg78q",
108-
"valid": false
109-
},
110104
{
111105
"description": "contains underscore",
112106
"data": "host_name",
@@ -355,6 +349,12 @@
355349
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.3 https://tools.ietf.org/html/rfc5892#appendix-A.1 https://www.w3.org/TR/alreq/#h_disjoining_enforcement",
356350
"data": "xn--ngba5hb2804a",
357351
"valid": true
352+
},
353+
{
354+
"description": "contains \"--\" in the 3rd and 4th position",
355+
"comment": "https://tools.ietf.org/html/rfc5891#section-4.2.3.1 https://tools.ietf.org/html/rfc5890#section-2.3.2.1",
356+
"data": "XN--aa---o47jg78q",
357+
"valid": false
358358
}
359359
]
360360
}

test/jsonschema/cases/draft2019-09/propertyNames.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@
4848
"description": "ignores other non-objects",
4949
"data": 12,
5050
"valid": true
51+
},
52+
{
53+
"description": "ignores null",
54+
"data": null,
55+
"valid": true
56+
},
57+
{
58+
"description": "ignores booleans",
59+
"data": true,
60+
"valid": true
5161
}
5262
]
5363
},

test/jsonschema/cases/draft2020-12/minProperties.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@
4040
"description": "ignores other non-objects",
4141
"data": 12,
4242
"valid": true
43+
},
44+
{
45+
"description": "ignores null",
46+
"data": null,
47+
"valid": true
48+
},
49+
{
50+
"description": "ignores booleans",
51+
"data": true,
52+
"valid": true
4353
}
4454
]
4555
},

0 commit comments

Comments
 (0)