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.
6 esid: sec-temporal.plainmonthday.prototype.equals
7 description: UTC offset not valid with format that does not include a time
11 const instance = new Temporal.PlainMonthDay(5, 2);
13 const validStrings = [
14 "05-02[Asia/Katmandu]",
15 "05-02[!Asia/Katmandu]",
16 "05-02[u-ca=iso8601]",
17 "05-02[Asia/Tokyo][u-ca=iso8601]",
18 "--05-02[Asia/Katmandu]",
19 "--05-02[!Asia/Katmandu]",
20 "--05-02[u-ca=iso8601]",
21 "--05-02[Asia/Tokyo][u-ca=iso8601]",
22 "2000-05-02T00+00:00",
23 "2000-05-02T00+00:00[UTC]",
24 "2000-05-02T00-02:30[America/St_Johns]",
27 for (const arg of validStrings) {
28 const result = instance.equals(arg);
33 `"${arg}" is a valid UTC offset with time for PlainMonthDay`
37 const invalidStrings = [
41 "09-15+01:00[Europe/Vienna]",
45 "--09-15+01:00[Europe/Vienna]",
48 "2022-09-15Z[Europe/Vienna]",
50 "2022-09-15+00:00[UTC]",
52 "2022-09-15-02:30[America/St_Johns]",
53 "09-15[u-ca=chinese]",
56 for (const arg of invalidStrings) {
59 () => instance.equals(arg),
60 `"${arg}" UTC offset without time is not valid for PlainMonthDay`