Skip to content

Commit 14ae1ee

Browse files
ioannadptomato
authored andcommitted
[Temporal] Move v8 staging test plain-date-with
Some tests in `test/staging/Temporal/v8/plain-date-with.js` are covered by tests in - `test/built-ins/Temporal/PlainDate/prototype/with/basic-year-month-day.js` - `test/intl402/Temporal/PlainDate/prototype/with/roc-basic.js - `test/built-ins/Temporal/PlainDate/prototype/with/plaindatelike-invalid.js` ---> add NaN, Infinity, array - `test/built-ins/Temporal/PlainDate/argument-invalid.js` - `test/built-ins/Temporal/PlainDate/prototype/with/branding.js` Move the rest of the tests to `test/built-ins/Temporal/PlainDate/prototype/with/time-units-ignored.js`
1 parent e4d82de commit 14ae1ee

File tree

3 files changed

+31
-60
lines changed

3 files changed

+31
-60
lines changed

test/built-ins/Temporal/PlainDate/prototype/with/plaindatelike-invalid.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const tests = [
2222
[Symbol(), "symbol"],
2323
[42, "number"],
2424
[42n, "bigint"],
25+
[NaN, "NaN"],
26+
[Infinity, "Infinity"],
2527

2628
// Step 4.
2729
// RejectObjectWithCalendarOrTimeZone step 2.
@@ -36,10 +38,10 @@ const tests = [
3638
// RejectObjectWithCalendarOrTimeZone step 5-6.
3739
[{ year: 2021, timeZone: "UTC" }, "timeZone"],
3840

39-
// Step 7.
41+
// Step 6.
4042
[{}, "empty object"],
43+
[[], "array"],
4144
[{ months: 12 }, "only plural property"],
42-
4345
];
4446

4547
for (const [value, message = String(value)] of tests) {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2021 the V8 project authors. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-temporal.plaindate.prototype.with
6+
description: Time units in the property bag are ignored
7+
includes: [temporalHelpers.js]
8+
features: [Temporal]
9+
---*/
10+
11+
let d1 = new Temporal.PlainDate(1911, 10, 10);
12+
TemporalHelpers.assertPlainDate(d1.with({
13+
year: 2021,
14+
hour: 30
15+
}), 2021, 10, 'M10', 10);
16+
TemporalHelpers.assertPlainDate(d1.with({
17+
month: 11,
18+
minute: 71
19+
}), 1911, 11, 'M11', 10);
20+
TemporalHelpers.assertPlainDate(d1.with({
21+
monthCode: 'M05',
22+
second: 90
23+
}), 1911, 5, 'M05', 10);
24+
TemporalHelpers.assertPlainDate(d1.with({
25+
day: 30,
26+
era: 'BC'
27+
}), 1911, 10, 'M10', 30);

test/staging/Temporal/v8/plain-date-with.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)