Test limits in PlainDate#toPlainYearMonth.

This commit is contained in:
Ms2ger 2022-02-01 17:57:31 +01:00 committed by Rick Waldron
parent 20329ef359
commit 331c144f2e
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// 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.plaindate.prototype.toplainyearmonth
description: toPlainYearMonth works within the supported range
includes: [temporalHelpers.js]
features: [Temporal]
---*/
const min = Temporal.PlainDate.from('-271821-04-19');
TemporalHelpers.assertPlainYearMonth(min.toPlainYearMonth(),
-271821, 4, "M04", "min");
const max = Temporal.PlainDate.from('+275760-09-13');
TemporalHelpers.assertPlainYearMonth(max.toPlainYearMonth(),
275760, 9, "M09", "max");