My working unpac space for OCaml projects in development
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Temporal: Add tests for unbalanced date/time separators

Add tests that strings like "2020-0101", "202001-01" in a date context
and "00:0000" and "0000:00" in a time context are rejected.

authored by

Tim Chevalier and committed by
Ms2ger
8d2a5a85 8931597f

+32 -5
+3
vendor/git/test262/test/built-ins/Temporal/PlainDate/from/argument-string-invalid.js
··· 50 50 // valid, but outside the supported range: 51 51 "-999999-01-01", 52 52 "+999999-01-01", 53 + // non-matching separators 54 + "2020-0101", 55 + "202001-01", 53 56 ]; 54 57 for (const arg of invalidStrings) { 55 58 assert.throws(
+6 -1
vendor/git/test262/test/built-ins/Temporal/PlainDateTime/from/argument-string-invalid.js
··· 50 50 "+999999-01-01", 51 51 // "00:0000" is invalid (the hour/minute and minute/second separator 52 52 // or lack thereof needs to match). 53 - "2025-01-01T00:00:00+00:0000" 53 + "2025-01-01T00:00:00+00:0000", 54 + "2025-01-01T00:00:00+0000:00", 55 + "202501-01T00:00:00", 56 + "2025-0101T00:00:00", 57 + "2025-01-01T00:0000", 58 + "2025-01-01T0000:00", 54 59 ]; 55 60 56 61 invalidStrings.forEach((s) => {
+3
vendor/git/test262/test/built-ins/Temporal/PlainTime/from/argument-string-invalid.js
··· 32 32 // "00:0000" is invalid (the hour/minute and minute/second separator 33 33 // or lack thereof needs to match). 34 34 "00:00:00+00:0000", 35 + "0000:00", 36 + "00:0000", 37 + "00:00:00+0000:00", 35 38 ]; 36 39 for (const arg of invalidStrings) { 37 40 assert.throws(
+20 -4
vendor/git/test262/test/built-ins/Temporal/ZonedDateTime/from/argument-string-invalid.js
··· 5 5 esid: sec-temporal.zoneddatetime.from 6 6 description: > 7 7 Check that UTC offsets are parsed properly 8 - features: [Temporal, Intl.Era-monthcode] 8 + features: [Temporal] 9 9 ---*/ 10 10 11 - assert.throws(RangeError, 12 - () => Temporal.ZonedDateTime.from("2025-01-01T00:00:00+00:0000[UTC]"), 13 - "UTCOffset must be of the form hh:mm:ss or hhmmss"); 11 + const invalidStrings = [ 12 + // UTCOffset must be of the form hh:mm:ss or hhmmss"); 13 + "2025-01-01T00:00:00+00:0000[UTC]", 14 + "2025-01-01T00:00:00+0000:00[UTC]", 15 + // Invalid date or time components, valid offset 16 + "202501-01T00:00:00+00:00[UTC]", 17 + "2025-0101T00:00:00+00:00[UTC]", 18 + "2025-01-01T00:0000+00:00[UTC]", 19 + "2025-01-01T0000:00+00:00[UTC]", 20 + ]; 21 + 22 + invalidStrings.forEach((s) => { 23 + assert.throws( 24 + RangeError, 25 + () => Temporal.ZonedDateTime.from(s), 26 + `invalid date-time string (${s})` 27 + ); 28 + }); 29 +