argument-string.js (743B)
1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally 2 // Copyright (C) 2022 Igalia, S.L. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-temporal.plainyearmonth.compare 7 description: A string is parsed into the correct object when passed as the argument 8 includes: [temporalHelpers.js] 9 features: [Temporal] 10 ---*/ 11 12 const validStrings = TemporalHelpers.ISO.plainYearMonthStringsValid().concat(TemporalHelpers.ISO.plainYearMonthStringsValidNegativeYear()); 13 14 for (const arg of validStrings) { 15 assert.sameValue( 16 Temporal.PlainYearMonth.compare(arg, arg), 17 0, 18 `"${arg}" is a valid PlainYearMonth string` 19 ); 20 } 21 22 reportCompare(0, 0);