diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string.js new file mode 100644 index 0000000000..e0cf058da2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string.js @@ -0,0 +1,24 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// 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.until +description: A string argument is parsed into a PlainYearMonth +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainYearMonth(1976, 11); +for (const arg of TemporalHelpers.ISO.plainYearMonthStringsValid()) { + const result = instance.until(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `"${arg}" is a valid PlainYearMonth string`); +} + +const instanceNegativeYear = new Temporal.PlainYearMonth(-9999, 11); +for (const arg of TemporalHelpers.ISO.plainYearMonthStringsValidNegativeYear()) { + const result = instanceNegativeYear.until(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `"${arg}" is a valid PlainYearMonth string`); +} + +reportCompare(0, 0); |