Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDate/from/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.plaindate.from
7 description: Various forms of calendar annotation; critical flag has no effect
8 features: [Temporal]
9 includes: [temporalHelpers.js]
10 ---*/
11
12 const tests = [
13 ["2000-05-02[u-ca=iso8601]", "without time or time zone"],
14 ["2000-05-02[UTC][u-ca=iso8601]", "with time zone and no time"],
15 ["2000-05-02T15:23[u-ca=iso8601]", "without time zone"],
16 ["2000-05-02T15:23[UTC][u-ca=iso8601]", "with time zone"],
17 ["2000-05-02T15:23[!u-ca=iso8601]", "with ! and no time zone"],
18 ["2000-05-02T15:23[UTC][!u-ca=iso8601]", "with ! and time zone"],
19 ["2000-05-02T15:23[u-ca=iso8601][u-ca=discord]", "second annotation ignored"],
20 ];
21
22 tests.forEach(([arg, description]) => {
23 const result = Temporal.PlainDate.from(arg);
24
25 TemporalHelpers.assertPlainDate(
26 result,
27 2000, 5, "M05", 2,
28 `calendar annotation (${description})`
29 );
30 });
31
32 reportCompare(0, 0);