Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-string-time-separators.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: Time separator in string argument can vary
8 features: [Temporal]
9 includes: [temporalHelpers.js]
10 ---*/
11
12 const tests = [
13 ["2000-05-02T15:23", "uppercase T"],
14 ["2000-05-02t15:23", "lowercase T"],
15 ["2000-05-02 15:23", "space between date and time"],
16 ];
17
18 tests.forEach(([arg, description]) => {
19 const result = Temporal.PlainDate.from(arg);
20
21 TemporalHelpers.assertPlainDate(
22 result,
23 2000, 5, "M05", 2,
24 `variant time separators (${description})`
25 );
26 });
27
28 reportCompare(0, 0);