Debian Codegraph @

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