Debian Codegraph @

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

raw
1 [
2 {
3 "description": "validation of date strings",
4 "schema": {
5 "$schema": "https://json-schema.org/draft/2019-09/schema",
6 "format": "date"
7 },
8 "tests": [
9 {
10 "description": "all string formats ignore integers",
11 "data": 12,
12 "valid": true
13 },
14 {
15 "description": "all string formats ignore floats",
16 "data": 13.7,
17 "valid": true
18 },
19 {
20 "description": "all string formats ignore objects",
21 "data": {},
22 "valid": true
23 },
24 {
25 "description": "all string formats ignore arrays",
26 "data": [],
27 "valid": true
28 },
29 {
30 "description": "all string formats ignore booleans",
31 "data": false,
32 "valid": true
33 },
34 {
35 "description": "all string formats ignore nulls",
36 "data": null,
37 "valid": true
38 },
39 {
40 "description": "a valid date string",
41 "data": "1963-06-19",
42 "valid": true
43 },
44 {
45 "description": "a valid date string with 31 days in January",
46 "data": "2020-01-31",
47 "valid": true
48 },
49 {
50 "description": "a invalid date string with 32 days in January",
51 "data": "2020-01-32",
52 "valid": false
53 },
54 {
55 "description": "a valid date string with 28 days in February (normal)",
56 "data": "2021-02-28",
57 "valid": true
58 },
59 {
60 "description": "a invalid date string with 30 days in February (leap)",
61 "data": "2020-02-30",
62 "valid": false
63 },
64 {
65 "description": "a valid date string with 31 days in March",
66 "data": "2020-03-31",
67 "valid": true
68 },
69 {
70 "description": "a invalid date string with 32 days in March",
71 "data": "2020-03-32",
72 "valid": false
73 },
74 {
75 "description": "a valid date string with 30 days in April",
76 "data": "2020-04-30",
77 "valid": true
78 },
79 {
80 "description": "a invalid date string with 31 days in April",
81 "data": "2020-04-31",
82 "valid": false
83 },
84 {
85 "description": "a valid date string with 31 days in May",
86 "data": "2020-05-31",
87 "valid": true
88 },
89 {
90 "description": "a invalid date string with 32 days in May",
91 "data": "2020-05-32",
92 "valid": false
93 },
94 {
95 "description": "a valid date string with 30 days in June",
96 "data": "2020-06-30",
97 "valid": true
98 },
99 {
100 "description": "a invalid date string with 31 days in June",
101 "data": "2020-06-31",
102 "valid": false
103 },
104 {
105 "description": "a valid date string with 31 days in July",
106 "data": "2020-07-31",
107 "valid": true
108 },
109 {
110 "description": "a invalid date string with 32 days in July",
111 "data": "2020-07-32",
112 "valid": false
113 },
114 {
115 "description": "a valid date string with 31 days in August",
116 "data": "2020-08-31",
117 "valid": true
118 },
119 {
120 "description": "a invalid date string with 32 days in August",
121 "data": "2020-08-32",
122 "valid": false
123 },
124 {
125 "description": "a valid date string with 30 days in September",
126 "data": "2020-09-30",
127 "valid": true
128 },
129 {
130 "description": "a invalid date string with 31 days in September",
131 "data": "2020-09-31",
132 "valid": false
133 },
134 {
135 "description": "a valid date string with 31 days in October",
136 "data": "2020-10-31",
137 "valid": true
138 },
139 {
140 "description": "a invalid date string with 32 days in October",
141 "data": "2020-10-32",
142 "valid": false
143 },
144 {
145 "description": "a valid date string with 30 days in November",
146 "data": "2020-11-30",
147 "valid": true
148 },
149 {
150 "description": "a invalid date string with 31 days in November",
151 "data": "2020-11-31",
152 "valid": false
153 },
154 {
155 "description": "a valid date string with 31 days in December",
156 "data": "2020-12-31",
157 "valid": true
158 },
159 {
160 "description": "a invalid date string with 32 days in December",
161 "data": "2020-12-32",
162 "valid": false
163 },
164 {
165 "description": "an invalid date string",
166 "data": "06/19/1963",
167 "valid": false
168 },
169 {
170 "description": "only RFC3339 not all of ISO 8601 are valid",
171 "data": "2013-350",
172 "valid": false
173 },
174 {
175 "description": "non-padded month dates are not valid",
176 "data": "1998-1-20",
177 "valid": false
178 },
179 {
180 "description": "non-padded day dates are not valid",
181 "data": "1998-01-1",
182 "valid": false
183 },
184 {
185 "description": "invalid month",
186 "data": "1998-13-01",
187 "valid": false
188 },
189 {
190 "description": "2021 is not a leap year",
191 "data": "2021-02-29",
192 "valid": false
193 },
194 {
195 "description": "2020 is a leap year",
196 "data": "2020-02-29",
197 "valid": true
198 },
199 {
200 "description": "invalid non-ASCII '৪' (a Bengali 4)",
201 "data": "1963-06-1৪",
202 "valid": false
203 },
204 {
205 "description": "invalid: non-ASCII Bengali digit in month field",
206 "data": "2020-0৪-01",
207 "valid": false
208 },
209 {
210 "description": "ISO8601 / non-RFC3339: YYYYMMDD without dashes (2023-03-28)",
211 "data": "20230328",
212 "valid": false
213 },
214 {
215 "description": "ISO8601 / non-RFC3339: week number implicit day of week (2023-01-02)",
216 "data": "2023-W01",
217 "valid": false
218 },
219 {
220 "description": "ISO8601 / non-RFC3339: week number with day of week (2023-03-28)",
221 "data": "2023-W13-2",
222 "valid": false
223 },
224 {
225 "description": "ISO8601 / non-RFC3339: week number rollover to next year (2023-01-01)",
226 "data": "2022W527",
227 "valid": false
228 },
229 {
230 "description": "an invalid time string in date-time format",
231 "data": "2020-11-28T23:55:45Z",
232 "valid": false
233 },
234 {
235 "description": "century year 0100 is not a leap year",
236 "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 100 % 100 == 0 but 100 % 400 != 0",
237 "data": "0100-02-29",
238 "valid": false
239 },
240 {
241 "description": "century year 0400 is a leap year",
242 "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — 400-year cycle boundary",
243 "data": "0400-02-29",
244 "valid": true
245 },
246 {
247 "description": "century year 2100 is not a leap year",
248 "comment": "https://www.rfc-editor.org/rfc/rfc3339#appendix-C — future century year",
249 "data": "2100-02-29",
250 "valid": false
251 },
252 {
253 "description": "invalid: leading whitespace is not permitted",
254 "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace",
255 "data": " 2024-01-15",
256 "valid": false
257 },
258 {
259 "description": "invalid: trailing whitespace is not permitted",
260 "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — full-date grammar does not include whitespace",
261 "data": "2024-01-15 ",
262 "valid": false
263 },
264 {
265 "description": "invalid: month 00 is not valid per date-month range 01-12",
266 "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-month = 2DIGIT ; 01-12",
267 "data": "2024-00-15",
268 "valid": false
269 },
270 {
271 "description": "invalid: day 00 is not valid per date-mday minimum of 01",
272 "comment": "https://www.rfc-editor.org/rfc/rfc3339#section-5.6 — date-mday = 2DIGIT ; 01-28/29/30/31",
273 "data": "2024-01-00",
274 "valid": false
275 },
276 {
277 "description": "invalid: empty string",
278 "data": "",
279 "valid": false
280 },
281 {
282 "description": "invalid: embedded whitespace between year and month",
283 "data": "2020 -01-01",
284 "valid": false
285 },
286 {
287 "description": "invalid: trailing character after valid full-date",
288 "data": "2020-01-01X",
289 "valid": false
290 },
291 {
292 "description": "invalid: trailing Z after full-date",
293 "data": "2020-01-01Z",
294 "valid": false
295 },
296 {
297 "description": "invalid: full-date followed by space and time component",
298 "data": "2020-01-01 00:00:00Z",
299 "valid": false
300 },
301 {
302 "description": "valid: four-digit year 0001",
303 "data": "0001-01-01",
304 "valid": true
305 },
306 {
307 "description": "invalid: two-digit year (N-2 digits)",
308 "data": "20-01-01",
309 "valid": false
310 },
311 {
312 "description": "invalid: three-digit year (N-1 digits)",
313 "data": "998-01-01",
314 "valid": false
315 },
316 {
317 "description": "invalid: five-digit year (N+1 digits)",
318 "data": "12020-01-01",
319 "valid": false
320 },
321 {
322 "description": "invalid: positive sign prefix on year",
323 "data": "+2020-01-01",
324 "valid": false
325 },
326 {
327 "description": "invalid: negative sign prefix on year",
328 "data": "-2020-01-01",
329 "valid": false
330 },
331 {
332 "description": "invalid: non-ASCII Bengali digit in year field",
333 "data": "২020-01-01",
334 "valid": false
335 },
336 {
337 "description": "invalid: alphabetic characters in year field",
338 "data": "YYYY-01-01",
339 "valid": false
340 },
341 {
342 "description": "invalid: three-digit month (N+1 digits)",
343 "data": "2020-001-01",
344 "valid": false
345 },
346 {
347 "description": "invalid: alphabetic characters in month field",
348 "data": "2020-MM-01",
349 "valid": false
350 },
351 {
352 "description": "invalid: three-digit day (N+1 digits)",
353 "data": "2020-01-001",
354 "valid": false
355 },
356 {
357 "description": "invalid: alphabetic characters in day field",
358 "data": "2020-01-DD",
359 "valid": false
360 },
361 {
362 "description": "invalid: colon separators",
363 "data": "2020:01:01",
364 "valid": false
365 },
366 {
367 "description": "invalid: dot separators",
368 "data": "2020.01.01",
369 "valid": false
370 },
371 {
372 "description": "invalid: space separators",
373 "data": "2020 01 01",
374 "valid": false
375 },
376 {
377 "description": "invalid: mixed slash and hyphen separators",
378 "data": "2020-01/01",
379 "valid": false
380 },
381 {
382 "description": "invalid: duplicated first hyphen",
383 "data": "2020--01-01",
384 "valid": false
385 },
386 {
387 "description": "invalid: duplicated second hyphen",
388 "data": "2020-01--01",
389 "valid": false
390 },
391 {
392 "description": "valid: date inside the Julian to Gregorian reform gap",
393 "data": "1582-10-10",
394 "valid": true
395 },
396 {
397 "description": "invalid: year field numerically larger than a 32-bit signed integer",
398 "data": "2147483648-01-01",
399 "valid": false
400 },
401 {
402 "description": "invalid: character just above '9' as the second digit of the day",
403 "data": "2020-01-0:",
404 "valid": false
405 },
406 {
407 "description": "invalid: non-ASCII digit leaving ten UTF-8 bytes but eight characters",
408 "data": "\u09e80-01-01",
409 "valid": false
410 },
411 {
412 "description": "invalid: en dash separators instead of hyphen-minus",
413 "data": "2020\u201301\u201301",
414 "valid": false
415 },
416 {
417 "description": "invalid: NUL character after an otherwise valid full-date",
418 "data": "2020-01-01\u0000",
419 "valid": false
420 }
421 ]
422 }
423 ]