Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainTime/compare/argument-string-calendar-annotation.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
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 calendar annotation; critical flag has no effect
8 features: [Temporal]
9 ---*/
10
11 const tests = [
12 ["12:34:56.987654321[u-ca=iso8601]", "without time zone"],
13 ["12:34:56.987654321[UTC][u-ca=iso8601]", "with time zone"],
14 ["12:34:56.987654321[!u-ca=iso8601]", "with ! and no time zone"],
15 ["12:34:56.987654321[UTC][!u-ca=iso8601]", "with ! and time zone"],
16 ["T12:34:56.987654321[u-ca=iso8601]", "with T and no time zone"],
17 ["T12:34:56.987654321[UTC][u-ca=iso8601]", "with T and time zone"],
18 ["T12:34:56.987654321[!u-ca=iso8601]", "with T, !, and no time zone"],
19 ["T12:34:56.987654321[UTC][!u-ca=iso8601]", "with T, !, and time zone"],
20 ["1970-01-01T12:34:56.987654321[u-ca=iso8601]", "with date and no time zone"],
21 ["1970-01-01T12:34:56.987654321[UTC][u-ca=iso8601]", "with date and time zone"],
22 ["1970-01-01T12:34:56.987654321[!u-ca=iso8601]", "with !, date, and no time zone"],
23 ["1970-01-01T12:34:56.987654321[UTC][!u-ca=iso8601]", "with !, date, and time zone"],
24 ["1970-01-01T12:34:56.987654321[u-ca=iso8601][u-ca=discord]", "second annotation ignored"],
25 ];
26
27 tests.forEach(([arg, description]) => {
28 const result = Temporal.PlainTime.compare(arg, arg);
29
30 assert.sameValue(
31 result,
32 0,
33 `calendar annotation (${description})`
34 );
35 });
36
37 reportCompare(0, 0);