argument-string-calendar-annotation.js (1078B)
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.instant.compare 7 description: Various forms of calendar annotation; critical flag has no effect 8 features: [Temporal] 9 ---*/ 10 11 const tests = [ 12 ["1970-01-01T00:00Z[u-ca=iso8601]", "without time zone"], 13 ["1970-01-01T00:00Z[UTC][u-ca=gregory]", "with time zone"], 14 ["1970-01-01T00:00Z[!u-ca=hebrew]", "with ! and no time zone"], 15 ["1970-01-01T00:00Z[UTC][!u-ca=chinese]", "with ! and time zone"], 16 ["1970-01-01T00:00Z[u-ca=discord]", "annotation is ignored"], 17 ["1970-01-01T00:00Z[!u-ca=discord]", "annotation with ! is ignored"], 18 ["1970-01-01T00:00Z[u-ca=iso8601][u-ca=discord]", "two annotations are ignored"], 19 ]; 20 21 tests.forEach(([arg, description]) => { 22 const result = Temporal.Instant.compare(arg, arg); 23 24 assert.sameValue( 25 result, 26 0, 27 `calendar annotation (${description})` 28 ); 29 }); 30 31 reportCompare(0, 0);