Skip to content

Commit 4c4c64e

Browse files
committed
test(format/date): add boundary whitespace and maximum boundary year cases
1 parent e491ac1 commit 4c4c64e

4 files changed

Lines changed: 80 additions & 0 deletions

File tree

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,26 @@
357357
"description": "invalid: alphabetic characters in day field",
358358
"data": "2020-01-DD",
359359
"valid": false
360+
},
361+
{
362+
"description": "invalid: leading tab character before valid date",
363+
"data": "\t2020-01-01",
364+
"valid": false
365+
},
366+
{
367+
"description": "invalid: trailing newline after valid date",
368+
"data": "2020-01-01\n",
369+
"valid": false
370+
},
371+
{
372+
"description": "invalid: leading non-breaking space before valid date",
373+
"data": "\u00A02020-01-01",
374+
"valid": false
375+
},
376+
{
377+
"description": "valid: maximum boundary full-date",
378+
"data": "9999-12-31",
379+
"valid": true
360380
}
361381
]
362382
}

tests/draft2020-12/optional/format/date.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,26 @@
357357
"description": "invalid: alphabetic characters in day field",
358358
"data": "2020-01-DD",
359359
"valid": false
360+
},
361+
{
362+
"description": "invalid: leading tab character before valid date",
363+
"data": "\t2020-01-01",
364+
"valid": false
365+
},
366+
{
367+
"description": "invalid: trailing newline after valid date",
368+
"data": "2020-01-01\n",
369+
"valid": false
370+
},
371+
{
372+
"description": "invalid: leading non-breaking space before valid date",
373+
"data": "\u00A02020-01-01",
374+
"valid": false
375+
},
376+
{
377+
"description": "valid: maximum boundary full-date",
378+
"data": "9999-12-31",
379+
"valid": true
360380
}
361381
]
362382
}

tests/draft7/optional/format/date.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,26 @@
354354
"description": "invalid: alphabetic characters in day field",
355355
"data": "2020-01-DD",
356356
"valid": false
357+
},
358+
{
359+
"description": "invalid: leading tab character before valid date",
360+
"data": "\t2020-01-01",
361+
"valid": false
362+
},
363+
{
364+
"description": "invalid: trailing newline after valid date",
365+
"data": "2020-01-01\n",
366+
"valid": false
367+
},
368+
{
369+
"description": "invalid: leading non-breaking space before valid date",
370+
"data": "\u00A02020-01-01",
371+
"valid": false
372+
},
373+
{
374+
"description": "valid: maximum boundary full-date",
375+
"data": "9999-12-31",
376+
"valid": true
357377
}
358378
]
359379
}

tests/v1/format/date.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,26 @@
357357
"description": "invalid: alphabetic characters in day field",
358358
"data": "2020-01-DD",
359359
"valid": false
360+
},
361+
{
362+
"description": "invalid: leading tab character before valid date",
363+
"data": "\t2020-01-01",
364+
"valid": false
365+
},
366+
{
367+
"description": "invalid: trailing newline after valid date",
368+
"data": "2020-01-01\n",
369+
"valid": false
370+
},
371+
{
372+
"description": "invalid: leading non-breaking space before valid date",
373+
"data": "\u00A02020-01-01",
374+
"valid": false
375+
},
376+
{
377+
"description": "valid: maximum boundary full-date",
378+
"data": "9999-12-31",
379+
"valid": true
360380
}
361381
]
362382
}

0 commit comments

Comments
 (0)