Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Instant/compare/argument-string-time-zone-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.instant.compare
7 description: Various forms of time zone annotation; critical flag has no effect
8 features: [Temporal]
9 ---*/
10
11 const tests = [
12 ["1970-01-01T00:00Z[Asia/Kolkata]", "named, with Z"],
13 ["1970-01-01T00:00Z[!Europe/Vienna]", "named, with Z and !"],
14 ["1970-01-01T00:00Z[+00:00]", "numeric, with Z"],
15 ["1970-01-01T00:00Z[!-02:30]", "numeric, with Z and !"],
16 ["1970-01-01T00:00+00:00[UTC]", "named, with offset"],
17 ["1970-01-01T00:00+00:00[!Africa/Abidjan]", "named, with offset and !"],
18 ["1970-01-01T00:00+00:00[-08:00]", "numeric, with offset"],
19 ["1970-01-01T00:00+00:00[!+01:00]", "numeric, with offset and !"],
20 ];
21
22 tests.forEach(([arg, description]) => {
23 const result = Temporal.Instant.compare(arg, arg);
24
25 assert.sameValue(
26 result,
27 0,
28 `time zone annotation (${description})`
29 );
30 });
31
32 reportCompare(0, 0);