mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Add a test for PlainYearMonth#toPlainDate().
This commit is contained in:
parent
439ac8c2dc
commit
3f88250aca
19
test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/limits.js
vendored
Normal file
19
test/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/limits.js
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// 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.plainyearmonth.prototype.toplaindate
|
||||||
|
description: Throws a RangeError if the resulting PlainDate is out of range
|
||||||
|
includes: [temporalHelpers.js]
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const min = Temporal.PlainYearMonth.from("-271821-04");
|
||||||
|
assert.throws(RangeError, () => min.toPlainDate({ day: 18 }), "min");
|
||||||
|
TemporalHelpers.assertPlainDate(min.toPlainDate({ day: 19 }),
|
||||||
|
-271821, 4, "M04", 19, "min");
|
||||||
|
|
||||||
|
const max = Temporal.PlainYearMonth.from("+275760-09");
|
||||||
|
assert.throws(RangeError, () => max.toPlainDate({ day: 14 }), "max");
|
||||||
|
TemporalHelpers.assertPlainDate(max.toPlainDate({ day: 13 }),
|
||||||
|
275760, 9, "M09", 13, "max");
|
Loading…
x
Reference in New Issue
Block a user