argument-string-calendar-annotation.js (1914B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2022 Igalia, S.L. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-temporal.plaintime.from 7 description: Various forms of calendar annotation; critical flag has no effect 8 features: [Temporal] 9 includes: [temporalHelpers.js] 10 ---*/ 11 12 const tests = [ 13 ["12:34:56.987654321[u-ca=iso8601]", "without time zone"], 14 ["12:34:56.987654321[UTC][u-ca=iso8601]", "with time zone"], 15 ["12:34:56.987654321[!u-ca=iso8601]", "with ! and no time zone"], 16 ["12:34:56.987654321[UTC][!u-ca=iso8601]", "with ! and time zone"], 17 ["T12:34:56.987654321[u-ca=iso8601]", "with T and no time zone"], 18 ["T12:34:56.987654321[UTC][u-ca=iso8601]", "with T and time zone"], 19 ["T12:34:56.987654321[!u-ca=iso8601]", "with T, !, and no time zone"], 20 ["T12:34:56.987654321[UTC][!u-ca=iso8601]", "with T, !, and time zone"], 21 ["1970-01-01T12:34:56.987654321[u-ca=iso8601]", "with date and no time zone"], 22 ["1970-01-01T12:34:56.987654321[UTC][u-ca=iso8601]", "with date and time zone"], 23 ["1970-01-01T12:34:56.987654321[!u-ca=iso8601]", "with !, date, and no time zone"], 24 ["1970-01-01T12:34:56.987654321[UTC][!u-ca=iso8601]", "with !, date, and time zone"], 25 ["12:34:56.987654321[u-ca=hebrew]", "calendar annotation ignored"], 26 ["12:34:56.987654321[u-ca=unknown]", "calendar annotation ignored even if unknown calendar"], 27 ["12:34:56.987654321[!u-ca=unknown]", "calendar annotation ignored even if unknown calendar with !"], 28 ["1970-01-01T12:34:56.987654321[u-ca=iso8601][u-ca=discord]", "second annotation ignored"], 29 ]; 30 31 tests.forEach(([arg, description]) => { 32 const result = Temporal.PlainTime.from(arg); 33 34 TemporalHelpers.assertPlainTime( 35 result, 36 12, 34, 56, 987, 654, 321, 37 `calendar annotation (${description})` 38 ); 39 }); 40 41 reportCompare(0, 0);