Test limits in PlainYearMonth constructor.

This commit is contained in:
Ms2ger 2022-02-01 16:55:02 +01:00 committed by Rick Waldron
parent 516f9a9083
commit f857cf9968

View File

@ -0,0 +1,20 @@
// 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
description: Limits for the PlainYearMonth constructor.
includes: [temporalHelpers.js]
features: [Temporal]
---*/
assert.throws(RangeError, () => new Temporal.PlainYearMonth(-271821, 3), "min");
assert.throws(RangeError, () => new Temporal.PlainYearMonth(275760, 10), "max");
TemporalHelpers.assertPlainYearMonth(new Temporal.PlainYearMonth(-271821, 4),
-271821, 4, "M04", "min");
TemporalHelpers.assertPlainYearMonth(new Temporal.PlainYearMonth(-271821, 4, "iso8601", 18),
-271821, 4, "M04", "min with referenceISODay");
TemporalHelpers.assertPlainYearMonth(new Temporal.PlainYearMonth(275760, 9),
275760, 9, "M09", "max");
TemporalHelpers.assertPlainYearMonth(new Temporal.PlainYearMonth(275760, 9, "iso8601", 14),
275760, 9, "M09", "max with referenceISODay");