mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Use the new collections of strings in TemporalHelpers.ISO to add more tests for ISO strings in API entry points that convert an ISO string to Temporal.PlainYearMonth or Temporal.PlainMonthDay.
20 lines
623 B
JavaScript
20 lines
623 B
JavaScript
// 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.compare
|
|
description: A string is parsed into the correct object when passed as the argument
|
|
includes: [temporalHelpers.js]
|
|
features: [Temporal]
|
|
---*/
|
|
|
|
const validStrings = TemporalHelpers.ISO.plainYearMonthStringsValid().concat(TemporalHelpers.ISO.plainYearMonthStringsValidNegativeYear());
|
|
|
|
for (const arg of validStrings) {
|
|
assert.sameValue(
|
|
Temporal.PlainYearMonth.compare(arg, arg),
|
|
0,
|
|
`"${arg}" is a valid PlainYearMonth string`
|
|
);
|
|
}
|