Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-string.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.from
7 description: String arguments are acceptable
8 features: [Temporal]
9 includes: [temporalHelpers.js]
10 ---*/
11
12 TemporalHelpers.assertPlainDateTime(
13 Temporal.PlainDateTime.from("1976-11-18T15:23:30"),
14 1976, 11, "M11", 18, 15, 23, 30, 0, 0, 0,
15 "date and time (no subseconds)"
16 );
17
18 TemporalHelpers.assertPlainDateTime(
19 Temporal.PlainDateTime.from("1976-11-18T15:23:30.001"),
20 1976, 11, "M11", 18, 15, 23, 30, 1, 0, 0,
21 "date and time (millisecond)"
22 );
23
24 TemporalHelpers.assertPlainDateTime(
25 Temporal.PlainDateTime.from("1976-11-18T15:23:30.001123"),
26 1976, 11, "M11", 18, 15, 23, 30, 1, 123, 0,
27 "date and time (microsecond)"
28 );
29
30 TemporalHelpers.assertPlainDateTime(
31 Temporal.PlainDateTime.from("1976-11-18T15:23:30.001123456"),
32 1976, 11, "M11", 18, 15, 23, 30, 1, 123, 456,
33 "date and time (nanosecond)"
34 );
35
36 reportCompare(0, 0);