Jesse Alama 7b78d4be74
Port some basic Temporal.PlainDateTime tests from Demitasse to test262 (#3430)
* Create a Temporal.PlainDateTime with all arguments supplied.

Migrates some tests that currently exist in the
proposal-temporal repo.

* Check all data in Temporal.PlainDateTimes, variously constructed

Enrich existing tests to check all basic data in the
instance of `Temporal.PlainDateTime`, not just a single
field.

These additional checks were motivated by the migration of
existing Demitasse tests in the proposal-temporal repo to
test262. The Demitasse tests check more than a single
field.
2022-03-21 12:16:18 -07:00

24 lines
646 B
JavaScript

// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindatetime
description: Hour argument defaults to 0 if not given
features: [Temporal]
includes: [temporalHelpers.js]
---*/
const args = [2000, 5, 2];
TemporalHelpers.assertPlainDateTime(
new Temporal.PlainDateTime(...args, undefined),
2000, 5, "M05", 2, 0, 0, 0, 0, 0, 0,
"hour default argument (argument present)"
);
TemporalHelpers.assertPlainDateTime(
new Temporal.PlainDateTime(...args),
2000, 5, "M05", 2, 0, 0, 0, 0, 0, 0,
"hour default argument (argument missing)"
);