argument-string-calendar-annotation.js (1004B)
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.plainyearmonth.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 ["2019-12-15T15:23[u-ca=iso8601]", "without time zone"], 14 ["2019-12-15T15:23[UTC][u-ca=iso8601]", "with time zone"], 15 ["2019-12-15T15:23[!u-ca=iso8601]", "with ! and no time zone"], 16 ["2019-12-15T15:23[UTC][!u-ca=iso8601]", "with ! and time zone"], 17 ["2019-12-15T15:23[u-ca=iso8601][u-ca=discord]", "second annotation ignored"], 18 ]; 19 20 tests.forEach(([arg, description]) => { 21 const result = Temporal.PlainYearMonth.from(arg); 22 23 TemporalHelpers.assertPlainYearMonth( 24 result, 25 2019, 12, "M12", 26 `calendar annotation (${description})` 27 ); 28 }); 29 30 reportCompare(0, 0);