argument-string-calendar-annotation.js (1068B)
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.plaindate.compare 7 description: Various forms of calendar annotation; critical flag has no effect 8 features: [Temporal] 9 ---*/ 10 11 const tests = [ 12 ["2000-05-02[u-ca=iso8601]", "without time or time zone"], 13 ["2000-05-02[UTC][u-ca=iso8601]", "with time zone and no time"], 14 ["2000-05-02T15:23[u-ca=iso8601]", "without time zone"], 15 ["2000-05-02T15:23[UTC][u-ca=iso8601]", "with time zone"], 16 ["2000-05-02T15:23[!u-ca=iso8601]", "with ! and no time zone"], 17 ["2000-05-02T15:23[UTC][!u-ca=iso8601]", "with ! and time zone"], 18 ["2000-05-02T15:23[u-ca=iso8601][u-ca=discord]", "second annotation ignored"], 19 ]; 20 21 tests.forEach(([arg, description]) => { 22 const result = Temporal.PlainDate.compare(arg, arg); 23 24 assert.sameValue( 25 result, 26 0, 27 `calendar annotation (${description})` 28 ); 29 }); 30 31 reportCompare(0, 0);