mirror of https://github.com/tc39/test262.git
Port tests for PlainYearMonth#{add,subtract}.
This commit is contained in:
parent
5cc9a6bda6
commit
df873eed1a
13
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-duration-object.js
vendored
Normal file
13
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-duration-object.js
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: A Duration object is supported as the argument
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const nov94 = Temporal.PlainYearMonth.from("1994-11");
|
||||
const diff = Temporal.Duration.from("P18Y7M");
|
||||
TemporalHelpers.assertPlainYearMonth(nov94.add(diff), 2013, 6, "M06");
|
38
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-lower-units.js
vendored
Normal file
38
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-lower-units.js
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: Using lower units in add() works
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
|
||||
const tests = [
|
||||
[{ days: 1 }, 2019, 11, "M11"],
|
||||
[{ days: 29 }, 2019, 11, "M11"],
|
||||
[{ hours: 1 }, 2019, 11, "M11"],
|
||||
[{ minutes: 1 }, 2019, 11, "M11"],
|
||||
[{ seconds: 1 }, 2019, 11, "M11"],
|
||||
[{ milliseconds: 1 }, 2019, 11, "M11"],
|
||||
[{ microseconds: 1 }, 2019, 11, "M11"],
|
||||
[{ nanoseconds: 1 }, 2019, 11, "M11"],
|
||||
[{ days: 30 }, 2019, 12, "M12"],
|
||||
[{ days: 31 }, 2019, 12, "M12"],
|
||||
[{ days: 60 }, 2019, 12, "M12"],
|
||||
[{ days: 61 }, 2020, 1, "M01"],
|
||||
[{ hours: 720 }, 2019, 12, "M12"],
|
||||
[{ minutes: 43200 }, 2019, 12, "M12"],
|
||||
[{ seconds: 2592000 }, 2019, 12, "M12"],
|
||||
[{ milliseconds: 2592000_000 }, 2019, 12, "M12"],
|
||||
[{ microseconds: 2592000_000_000 }, 2019, 12, "M12"],
|
||||
[{ nanoseconds: 2592000_000_000_000 }, 2019, 12, "M12"],
|
||||
];
|
||||
|
||||
for (const [argument, ...expected] of tests) {
|
||||
TemporalHelpers.assertPlainYearMonth(ym.add(argument), ...expected, "no options");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.add(argument, { overflow: "constrain" }), ...expected, "constrain");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.add(argument, { overflow: "reject" }), ...expected, "reject");
|
||||
}
|
16
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-object-invalid.js
vendored
Normal file
16
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-object-invalid.js
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: Mixed positive and negative values or missing properties always throw
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
for (const overflow of ["constrain", "reject"]) {
|
||||
assert.throws(RangeError, () => ym.add({ years: 1, months: -6 }, { overflow }), overflow)
|
||||
}
|
||||
|
||||
assert.throws(TypeError, () => ym.add({}), "no properties");
|
||||
assert.throws(TypeError, () => ym.add({ month: 12 }), "only singular 'month' property");
|
12
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-object-plural.js
vendored
Normal file
12
test/built-ins/Temporal/PlainYearMonth/prototype/add/argument-object-plural.js
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: Singular properties are ignored
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.add({ month: 1, years: 1 }), 2020, 11, "M11");
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: Passing an object to add() works
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
|
||||
const tests = [
|
||||
[{ months: 2 }, 2020, 1, "M01"],
|
||||
[{ years: 1 }, 2020, 11, "M11"],
|
||||
[{ months: -2 }, 2019, 9, "M09"],
|
||||
[{ years: -1 }, 2018, 11, "M11"],
|
||||
];
|
||||
|
||||
for (const [argument, ...expected] of tests) {
|
||||
TemporalHelpers.assertPlainYearMonth(ym.add(argument), ...expected, "no options");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.add(argument, { overflow: "constrain" }), ...expected, "constrain");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.add(argument, { overflow: "reject" }), ...expected, "reject");
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: RangeError thrown when going out of range
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const max = Temporal.PlainYearMonth.from("+275760-09");
|
||||
for (const overflow of ["reject", "constrain"]) {
|
||||
assert.throws(RangeError, () => max.add({ months: 1 }, { overflow }), overflow);
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: add() takes month length into account
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-02").add({ days: 27 }),
|
||||
2019, 2, "M02");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-02").add({ days: 28 }),
|
||||
2019, 3, "M03");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-02").add({ days: 28 }),
|
||||
2020, 2, "M02");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-02").add({ days: 29 }),
|
||||
2020, 3, "M03");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-11").add({ days: 29 }),
|
||||
2019, 11, "M11");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-11").add({ days: 30 }),
|
||||
2019, 12, "M12");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-01").add({ days: 30 }),
|
||||
2020, 1, "M01");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-01").add({ days: 31 }),
|
||||
2020, 2, "M02");
|
|
@ -0,0 +1,14 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.add
|
||||
description: Invalid options throw
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
const values = [null, true, "hello", Symbol("foo"), 1, 1n];
|
||||
for (const badOptions of values) {
|
||||
assert.throws(TypeError, () => ym.add({ years: 1 }, badOptions));
|
||||
}
|
|
@ -20,4 +20,6 @@ features: [Temporal]
|
|||
|
||||
const yearmonth = new Temporal.PlainYearMonth(2000, 5);
|
||||
const duration = new Temporal.Duration(1, 1);
|
||||
assert.throws(RangeError, () => yearmonth.add(duration, { overflow: "other string" }));
|
||||
for (const overflow of ["", "CONSTRAIN", "balance", "other string", "constra\u0131n"]) {
|
||||
assert.throws(RangeError, () => yearmonth.add(duration, { overflow }));
|
||||
}
|
||||
|
|
|
@ -29,3 +29,5 @@ const explicit = yearmonth.add(duration, { overflow: undefined });
|
|||
TemporalHelpers.assertPlainYearMonth(explicit, 2001, 6, "M06", "default overflow is constrain");
|
||||
const implicit = yearmonth.add(duration, {});
|
||||
TemporalHelpers.assertPlainYearMonth(implicit, 2001, 6, "M06", "default overflow is constrain");
|
||||
const lambda = yearmonth.add(duration, () => {});
|
||||
TemporalHelpers.assertPlainYearMonth(lambda, 2001, 6, "M06", "default overflow is constrain");
|
||||
|
|
|
@ -29,6 +29,7 @@ assert.throws(RangeError, () => yearmonth.add(duration, { overflow: null }), "nu
|
|||
assert.throws(RangeError, () => yearmonth.add(duration, { overflow: true }), "true");
|
||||
assert.throws(RangeError, () => yearmonth.add(duration, { overflow: false }), "false");
|
||||
assert.throws(TypeError, () => yearmonth.add(duration, { overflow: Symbol() }), "symbol");
|
||||
assert.throws(RangeError, () => yearmonth.add(duration, { overflow: 2 }), "bigint");
|
||||
assert.throws(RangeError, () => yearmonth.add(duration, { overflow: 2n }), "bigint");
|
||||
assert.throws(RangeError, () => yearmonth.add(duration, { overflow: {} }), "plain object");
|
||||
|
||||
|
|
13
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-duration-object.js
vendored
Normal file
13
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-duration-object.js
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: A Duration object is supported as the argument
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const jun13 = Temporal.PlainYearMonth.from("2013-06");
|
||||
const diff = Temporal.Duration.from("P18Y7M");
|
||||
TemporalHelpers.assertPlainYearMonth(jun13.subtract(diff), 1994, 11, "M11");
|
37
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-lower-units.js
vendored
Normal file
37
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-lower-units.js
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: Using lower units in subtract() works
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
|
||||
const tests = [
|
||||
[{ days: 1 }, 2019, 11, "M11"],
|
||||
[{ hours: 1 }, 2019, 11, "M11"],
|
||||
[{ minutes: 1 }, 2019, 11, "M11"],
|
||||
[{ seconds: 1 }, 2019, 11, "M11"],
|
||||
[{ milliseconds: 1 }, 2019, 11, "M11"],
|
||||
[{ microseconds: 1 }, 2019, 11, "M11"],
|
||||
[{ nanoseconds: 1 }, 2019, 11, "M11"],
|
||||
[{ days: 29 }, 2019, 11, "M11"],
|
||||
[{ days: 30 }, 2019, 10, "M10"],
|
||||
[{ days: 60 }, 2019, 10, "M10"],
|
||||
[{ days: 61 }, 2019, 9, "M09"],
|
||||
[{ hours: 720 }, 2019, 10, "M10"],
|
||||
[{ minutes: 43200 }, 2019, 10, "M10"],
|
||||
[{ seconds: 2592000 }, 2019, 10, "M10"],
|
||||
[{ milliseconds: 2592000_000 }, 2019, 10, "M10"],
|
||||
[{ microseconds: 2592000_000_000 }, 2019, 10, "M10"],
|
||||
[{ nanoseconds: 2592000_000_000_000 }, 2019, 10, "M10"],
|
||||
];
|
||||
|
||||
for (const [argument, ...expected] of tests) {
|
||||
TemporalHelpers.assertPlainYearMonth(ym.subtract(argument), ...expected, "no options");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.subtract(argument, { overflow: "constrain" }), ...expected, "constrain");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.subtract(argument, { overflow: "reject" }), ...expected, "reject");
|
||||
}
|
16
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-object-invalid.js
vendored
Normal file
16
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-object-invalid.js
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: Mixed positive and negative values or missing properties always throw
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
for (const overflow of ["constrain", "reject"]) {
|
||||
assert.throws(RangeError, () => ym.subtract({ years: 1, months: -6 }, { overflow }), overflow)
|
||||
}
|
||||
|
||||
assert.throws(TypeError, () => ym.subtract({}), "no properties");
|
||||
assert.throws(TypeError, () => ym.subtract({ month: 12 }), "only singular 'month' property");
|
12
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-object-plural.js
vendored
Normal file
12
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-object-plural.js
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: Singular properties are ignored
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.subtract({ month: 1, years: 1 }), 2018, 11, "M11");
|
24
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-object.js
vendored
Normal file
24
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/argument-object.js
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: Passing an object to subtract() works
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
|
||||
const tests = [
|
||||
[{ months: 2 }, 2019, 9, "M09"],
|
||||
[{ years: 1 }, 2018, 11, "M11"],
|
||||
[{ months: -2 }, 2020, 1, "M01"],
|
||||
[{ years: -1 }, 2020, 11, "M11"],
|
||||
];
|
||||
|
||||
for (const [argument, ...expected] of tests) {
|
||||
TemporalHelpers.assertPlainYearMonth(ym.subtract(argument), ...expected, "no options");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.subtract(argument, { overflow: "constrain" }), ...expected, "constrain");
|
||||
TemporalHelpers.assertPlainYearMonth(ym.subtract(argument, { overflow: "reject" }), ...expected, "reject");
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: RangeError thrown when going out of range
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const min = Temporal.PlainYearMonth.from("-271821-04");
|
||||
for (const overflow of ["reject", "constrain"]) {
|
||||
assert.throws(RangeError, () => min.subtract({ months: 1 }, { overflow }), overflow);
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: subtract() takes month length into account
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-02").subtract({ days: 27 }),
|
||||
2019, 2, "M02");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-02").subtract({ days: 28 }),
|
||||
2019, 1, "M01");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-02").subtract({ days: 28 }),
|
||||
2020, 2, "M02");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-02").subtract({ days: 29 }),
|
||||
2020, 1, "M01");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-11").subtract({ days: 29 }),
|
||||
2019, 11, "M11");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2019-11").subtract({ days: 30 }),
|
||||
2019, 10, "M10");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-01").subtract({ days: 30 }),
|
||||
2020, 1, "M01");
|
||||
TemporalHelpers.assertPlainYearMonth(Temporal.PlainYearMonth.from("2020-01").subtract({ days: 31 }),
|
||||
2019, 12, "M12");
|
14
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/options-invalid.js
vendored
Normal file
14
test/built-ins/Temporal/PlainYearMonth/prototype/subtract/options-invalid.js
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plainyearmonth.prototype.subtract
|
||||
description: Invalid options throw
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const ym = Temporal.PlainYearMonth.from("2019-11");
|
||||
const values = [null, true, "hello", Symbol("foo"), 1, 1n];
|
||||
for (const badOptions of values) {
|
||||
assert.throws(TypeError, () => ym.subtract({ years: 1 }, badOptions));
|
||||
}
|
|
@ -20,4 +20,6 @@ features: [Temporal]
|
|||
|
||||
const yearmonth = new Temporal.PlainYearMonth(2000, 5);
|
||||
const duration = new Temporal.Duration(1, 1);
|
||||
assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow: "other string" }));
|
||||
for (const overflow of ["", "CONSTRAIN", "balance", "other string", "constra\u0131n"]) {
|
||||
assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow }));
|
||||
}
|
||||
|
|
|
@ -29,3 +29,5 @@ const explicit = yearmonth.subtract(duration, { overflow: undefined });
|
|||
TemporalHelpers.assertPlainYearMonth(explicit, 1999, 4, "M04", "default overflow is constrain");
|
||||
const implicit = yearmonth.subtract(duration, {});
|
||||
TemporalHelpers.assertPlainYearMonth(implicit, 1999, 4, "M04", "default overflow is constrain");
|
||||
const lambda = yearmonth.subtract(duration, () => {});
|
||||
TemporalHelpers.assertPlainYearMonth(lambda, 1999, 4, "M04", "default overflow is constrain");
|
||||
|
|
|
@ -29,6 +29,7 @@ assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow: null })
|
|||
assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow: true }), "true");
|
||||
assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow: false }), "false");
|
||||
assert.throws(TypeError, () => yearmonth.subtract(duration, { overflow: Symbol() }), "symbol");
|
||||
assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow: 2 }), "bigint");
|
||||
assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow: 2n }), "bigint");
|
||||
assert.throws(RangeError, () => yearmonth.subtract(duration, { overflow: {} }), "plain object");
|
||||
|
||||
|
|
Loading…
Reference in New Issue