argument-string-unknown-annotation.js (1544B)
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.compare 7 description: Various forms of unknown annotation 8 features: [Temporal] 9 ---*/ 10 11 const tests = [ 12 ["12:34:56.987654321[foo=bar]", "alone"], 13 ["12:34:56.987654321[UTC][foo=bar]", "with time zone"], 14 ["12:34:56.987654321[u-ca=iso8601][foo=bar]", "with calendar"], 15 ["12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with time zone and calendar"], 16 ["T12:34:56.987654321[foo=bar]", "with T"], 17 ["T12:34:56.987654321[UTC][foo=bar]", "with T and time zone"], 18 ["T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with T and calendar"], 19 ["T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with T, time zone, and calendar"], 20 ["1970-01-01T12:34:56.987654321[foo=bar]", "with date"], 21 ["1970-01-01T12:34:56.987654321[UTC][foo=bar]", "with date and time zone"], 22 ["1970-01-01T12:34:56.987654321[u-ca=iso8601][foo=bar]", "with date and calendar"], 23 ["1970-01-01T12:34:56.987654321[UTC][foo=bar][u-ca=iso8601]", "with date, time zone, and calendar"], 24 ["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"], 25 ]; 26 27 tests.forEach(([arg, description]) => { 28 const result = Temporal.PlainTime.compare(arg, arg); 29 30 assert.sameValue( 31 result, 32 0, 33 `unknown annotation (${description})` 34 ); 35 }); 36 37 reportCompare(0, 0);