From 374aac475d9de91720b56c06aba5da6a43b306be Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 11 Jan 2023 12:20:09 -0800 Subject: [PATCH] Regularize "calendar-case-insensitive" tests For each entry point where a string calendar name is accepted, we should have a test that ensures the calendar name is case-insensitive. These tests existed but several were incomplete as they didn't take nested properties into account, and several entry points were missing this test. Fix a minor copy-paste issue with double semicolons. --- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 25 +++++++++++++++++++ ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 20 +++++++++++++++ .../calendar-case-insensitive.js | 2 +- ...t-propertybag-calendar-case-insensitive.js | 22 ++++++++++++++++ ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- .../withCalendar/calendar-case-insensitive.js | 2 +- ...t-propertybag-calendar-case-insensitive.js | 22 ++++++++++++++++ ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- .../withCalendar/calendar-case-insensitive.js | 2 +- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 22 ++++++++++++++++ ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- .../calendar-case-insensitive.js | 2 +- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 25 +++++++++++++++++++ ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- .../withCalendar/calendar-case-insensitive.js | 2 +- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- ...t-propertybag-calendar-case-insensitive.js | 10 +++++--- 50 files changed, 414 insertions(+), 122 deletions(-) create mode 100644 test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-case-insensitive.js create mode 100644 test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-case-insensitive.js create mode 100644 test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-case-insensitive.js create mode 100644 test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-case-insensitive.js create mode 100644 test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-case-insensitive.js create mode 100644 test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js diff --git a/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-case-insensitive.js index a2abea1820..57c535a19d 100644 --- a/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.dateAdd(arg, new Temporal.Duration()); -TemporalHelpers.assertPlainDate(result, 1976, 11, "M11", 18, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.dateAdd(arg, new Temporal.Duration()); +TemporalHelpers.assertPlainDate(result1, 1976, 11, "M11", 18, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.dateAdd(arg, new Temporal.Duration()); +TemporalHelpers.assertPlainDate(result2, 1976, 11, "M11", 18, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-case-insensitive.js new file mode 100644 index 0000000000..214d04f702 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,25 @@ +// 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.calendar.prototype.dateuntil +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +const calendar = "IsO8601"; + +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.dateUntil(arg, new Temporal.PlainDate(1976, 11, 19)); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (first argument)"); +const result2 = instance.dateUntil(new Temporal.PlainDate(1976, 11, 19), arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (second argument)"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result3 = instance.dateUntil(arg, new Temporal.PlainDate(1976, 11, 19)); +TemporalHelpers.assertDuration(result3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property, first argument)"); +const result4 = instance.dateUntil(new Temporal.PlainDate(1976, 11, 19), arg); +TemporalHelpers.assertDuration(result4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property, second argument)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-case-insensitive.js index 818bfa4b36..4719772acd 100644 --- a/test/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.day(arg); -assert.sameValue(result, 18, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.day(arg); +assert.sameValue(result1, 18, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.day(arg); +assert.sameValue(result2, 18, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-case-insensitive.js index 33aec65e06..67139a93c1 100644 --- a/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.dayOfWeek(arg); -assert.sameValue(result, 4, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.dayOfWeek(arg); +assert.sameValue(result1, 4, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.dayOfWeek(arg); +assert.sameValue(result2, 4, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-case-insensitive.js index 90d94eae52..160354ee72 100644 --- a/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.dayOfYear(arg); -assert.sameValue(result, 323, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.dayOfYear(arg); +assert.sameValue(result1, 323, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.dayOfYear(arg); +assert.sameValue(result2, 323, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-case-insensitive.js index ea94de6225..c1b9ca391c 100644 --- a/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.daysInMonth(arg); -assert.sameValue(result, 30, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.daysInMonth(arg); +assert.sameValue(result1, 30, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.daysInMonth(arg); +assert.sameValue(result2, 30, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-case-insensitive.js index a938b2a910..2123e069bd 100644 --- a/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.daysInWeek(arg); -assert.sameValue(result, 7, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.daysInWeek(arg); +assert.sameValue(result1, 7, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.daysInWeek(arg); +assert.sameValue(result2, 7, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-case-insensitive.js index bbee13e512..c2faf61258 100644 --- a/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.daysInYear(arg); -assert.sameValue(result, 366, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.daysInYear(arg); +assert.sameValue(result1, 366, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.daysInYear(arg); +assert.sameValue(result2, 366, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-case-insensitive.js index 49f8b41825..b0a6ad3f6c 100644 --- a/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.inLeapYear(arg); -assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.inLeapYear(arg); +assert.sameValue(result1, true, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.inLeapYear(arg); +assert.sameValue(result2, true, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-case-insensitive.js index 7314b5f0b8..d45fc71c9e 100644 --- a/test/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.month(arg); -assert.sameValue(result, 11, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.month(arg); +assert.sameValue(result1, 11, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.month(arg); +assert.sameValue(result2, 11, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-case-insensitive.js index 6ea4441c83..2df095d874 100644 --- a/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.monthCode(arg); -assert.sameValue(result, "M11", `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.monthCode(arg); +assert.sameValue(result1, "M11", "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.monthCode(arg); +assert.sameValue(result2, "M11", "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-case-insensitive.js index 90a33288ce..a4df5461ca 100644 --- a/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.monthsInYear(arg); -assert.sameValue(result, 12, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.monthsInYear(arg); +assert.sameValue(result1, 12, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.monthsInYear(arg); +assert.sameValue(result2, 12, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-case-insensitive.js index 0927a1a430..cab959c670 100644 --- a/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.weekOfYear(arg); -assert.sameValue(result, 47, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.weekOfYear(arg); +assert.sameValue(result1, 47, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.weekOfYear(arg); +assert.sameValue(result2, 47, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-case-insensitive.js index dacab7db74..c9499e0af0 100644 --- a/test/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.year(arg); -assert.sameValue(result, 1976, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.year(arg); +assert.sameValue(result1, 1976, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.year(arg); +assert.sameValue(result2, 1976, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-case-insensitive.js new file mode 100644 index 0000000000..c3c513e500 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,20 @@ +// 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.calendar.prototype.yearofweek +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +const calendar = "IsO8601"; + +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.yearOfWeek(arg); +assert.sameValue(result1, 1976, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.yearOfWeek(arg); +assert.sameValue(result2, 1976, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-case-insensitive.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-case-insensitive.js index 56e6cecabb..ed23625dab 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-case-insensitive.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-case-insensitive.js @@ -9,6 +9,6 @@ features: [Temporal] const instance = new Temporal.Instant(1_000_000_000_000_000_000n); -const arg = "iSo8601";; +const arg = "iSo8601"; const result = instance.toZonedDateTime({ calendar: arg, timeZone: "UTC" }); assert.sameValue(result.calendar.id, "iso8601", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-case-insensitive.js new file mode 100644 index 0000000000..f1c81c7b1b --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,22 @@ +// 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.compare +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +const calendar = "IsO8601"; + +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = Temporal.PlainDate.compare(arg, new Temporal.PlainDate(1976, 11, 18)); +assert.sameValue(result1, 0, "Calendar is case-insensitive (first argument)"); +const result2 = Temporal.PlainDate.compare(new Temporal.PlainDate(1976, 11, 18), arg); +assert.sameValue(result2, 0, "Calendar is case-insensitive (second argument)"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result3 = Temporal.PlainDate.compare(arg, new Temporal.PlainDate(1976, 11, 18)); +assert.sameValue(result3, 0, "Calendar is case-insensitive (nested property, first argument)"); +const result4 = Temporal.PlainDate.compare(new Temporal.PlainDate(1976, 11, 18), arg); +assert.sameValue(result4, 0, "Calendar is case-insensitive (nested property, second argument)"); diff --git a/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-case-insensitive.js index 2284e44ed5..e756f79c55 100644 --- a/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-case-insensitive.js @@ -10,6 +10,10 @@ features: [Temporal] const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = Temporal.PlainDate.from(arg); -TemporalHelpers.assertPlainDate(result, 1976, 11, "M11", 18, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = Temporal.PlainDate.from(arg); +TemporalHelpers.assertPlainDate(result1, 1976, 11, "M11", 18, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = Temporal.PlainDate.from(arg); +TemporalHelpers.assertPlainDate(result2, 1976, 11, "M11", 18, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-case-insensitive.js index 1913409488..2bbc7834b3 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.PlainDate(1976, 11, 18); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.equals(arg); -assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.equals(arg); +assert.sameValue(result1, true, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.equals(arg); +assert.sameValue(result2, true, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-case-insensitive.js index 617fa439c3..976d5920a3 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainDate(1976, 11, 18); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.since(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.since(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.since(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-case-insensitive.js index 3cddfb4546..db2b4d76ba 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainDate(1976, 11, 18); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.until(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.until(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.until(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-case-insensitive.js index 94f6ca737e..2199a02bac 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-case-insensitive.js @@ -9,6 +9,6 @@ features: [Temporal] const instance = new Temporal.PlainDate(1976, 11, 18, { id: "replace-me" }); -const arg = "iSo8601";; +const arg = "iSo8601"; const result = instance.withCalendar(arg); assert.sameValue(result.calendar.id, "iso8601", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-case-insensitive.js new file mode 100644 index 0000000000..094f274838 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,22 @@ +// 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.plaindatetime.compare +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +const calendar = "IsO8601"; + +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = Temporal.PlainDateTime.compare(arg, new Temporal.PlainDateTime(1976, 11, 18)); +assert.sameValue(result1, 0, "Calendar is case-insensitive (first argument)"); +const result2 = Temporal.PlainDateTime.compare(new Temporal.PlainDateTime(1976, 11, 18), arg); +assert.sameValue(result2, 0, "Calendar is case-insensitive (second argument)"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result3 = Temporal.PlainDateTime.compare(arg, new Temporal.PlainDateTime(1976, 11, 18)); +assert.sameValue(result3, 0, "Calendar is case-insensitive (nested property, first argument)"); +const result4 = Temporal.PlainDateTime.compare(new Temporal.PlainDateTime(1976, 11, 18), arg); +assert.sameValue(result4, 0, "Calendar is case-insensitive (nested property, second argument)"); diff --git a/test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-case-insensitive.js index 385a2f4140..349075e6f6 100644 --- a/test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-case-insensitive.js @@ -10,6 +10,10 @@ features: [Temporal] const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = Temporal.PlainDateTime.from(arg); -TemporalHelpers.assertPlainDateTime(result, 1976, 11, "M11", 18, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = Temporal.PlainDateTime.from(arg); +TemporalHelpers.assertPlainDateTime(result1, 1976, 11, "M11", 18, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = Temporal.PlainDateTime.from(arg); +TemporalHelpers.assertPlainDateTime(result2, 1976, 11, "M11", 18, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js index 6bde0037fd..7d1f00f5fd 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.PlainDateTime(1976, 11, 18); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.equals(arg); -assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.equals(arg); +assert.sameValue(result1, true, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.equals(arg); +assert.sameValue(result2, true, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js index 01824a81cc..b9ec567572 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainDateTime(1976, 11, 18); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.since(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.since(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.since(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js index f07d2cb61c..d0f739e30d 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainDateTime(1976, 11, 18); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.until(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.until(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.until(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-case-insensitive.js index b1fe3687e4..cdca3fe44f 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-case-insensitive.js @@ -9,6 +9,6 @@ features: [Temporal] const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, { id: "replace-me" }); -const arg = "iSo8601";; +const arg = "iSo8601"; const result = instance.withCalendar(arg); assert.sameValue(result.calendar.id, "iso8601", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js index aae3d153b6..de04c1e692 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 32 const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.withPlainDate(arg); -TemporalHelpers.assertPlainDateTime(result, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.withPlainDate(arg); +TemporalHelpers.assertPlainDateTime(result1, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.withPlainDate(arg); +TemporalHelpers.assertPlainDateTime(result2, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-case-insensitive.js index c1da873686..1f18ec3246 100644 --- a/test/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-case-insensitive.js @@ -10,6 +10,10 @@ features: [Temporal] const calendar = "IsO8601"; -const arg = { monthCode: "M11", day: 18, calendar }; -const result = Temporal.PlainMonthDay.from(arg); -TemporalHelpers.assertPlainMonthDay(result, "M11", 18, `Calendar created from string "${calendar}"`); +let arg = { monthCode: "M11", day: 18, calendar }; +const result1 = Temporal.PlainMonthDay.from(arg); +TemporalHelpers.assertPlainMonthDay(result1, "M11", 18, "Calendar is case-insensitive"); + +arg = { monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = Temporal.PlainMonthDay.from(arg); +TemporalHelpers.assertPlainMonthDay(result2, "M11", 18, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-case-insensitive.js index b7b355879a..386f3da59a 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.PlainMonthDay(11, 18); const calendar = "IsO8601"; -const arg = { monthCode: "M11", day: 18, calendar }; -const result = instance.equals(arg); -assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +let arg = { monthCode: "M11", day: 18, calendar }; +const result1 = instance.equals(arg); +assert.sameValue(result1, true, "Calendar is case-insensitive"); + +arg = { monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.equals(arg); +assert.sameValue(result2, true, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-case-insensitive.js index 8ae9de839e..710e28d458 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.toPlainDateTime(arg); -TemporalHelpers.assertPlainDateTime(result, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.toPlainDateTime(arg); +TemporalHelpers.assertPlainDateTime(result1, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.toPlainDateTime(arg); +TemporalHelpers.assertPlainDateTime(result2, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-case-insensitive.js index e439eb627f..39d3572bea 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }); -assert.sameValue(result.epochNanoseconds, 217_168_496_987_654_321n, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }); +assert.sameValue(result1.epochNanoseconds, 217_168_496_987_654_321n, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }); +assert.sameValue(result2.epochNanoseconds, 217_168_496_987_654_321n, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-case-insensitive.js new file mode 100644 index 0000000000..0fe7e6675e --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,22 @@ +// 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: The calendar name is case-insensitive +features: [Temporal] +---*/ + +const calendar = "IsO8601"; + +let arg = { year: 2019, monthCode: "M06", calendar }; +const result1 = Temporal.PlainYearMonth.compare(arg, new Temporal.PlainYearMonth(2019, 6)); +assert.sameValue(result1, 0, "Calendar is case-insensitive (first argument)"); +const result2 = Temporal.PlainYearMonth.compare(new Temporal.PlainYearMonth(2019, 6), arg); +assert.sameValue(result2, 0, "Calendar is case-insensitive (second argument)"); + +arg = { year: 2019, monthCode: "M06", calendar: { calendar } }; +const result3 = Temporal.PlainYearMonth.compare(arg, new Temporal.PlainYearMonth(2019, 6)); +assert.sameValue(result3, 0, "Calendar is case-insensitive (nested property, first argument)"); +const result4 = Temporal.PlainYearMonth.compare(new Temporal.PlainYearMonth(2019, 6), arg); +assert.sameValue(result4, 0, "Calendar is case-insensitive (nested property, second argument)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-case-insensitive.js index 4273fe3df1..24dbb023aa 100644 --- a/test/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-case-insensitive.js @@ -10,6 +10,10 @@ features: [Temporal] const calendar = "IsO8601"; -const arg = { year: 2019, monthCode: "M06", calendar }; -const result = Temporal.PlainYearMonth.from(arg); -TemporalHelpers.assertPlainYearMonth(result, 2019, 6, "M06", `Calendar created from string "${calendar}"`); +let arg = { year: 2019, monthCode: "M06", calendar }; +const result1 = Temporal.PlainYearMonth.from(arg); +TemporalHelpers.assertPlainYearMonth(result1, 2019, 6, "M06", "Calendar is case-insensitive"); + +arg = { year: 2019, monthCode: "M06", calendar: { calendar } }; +const result2 = Temporal.PlainYearMonth.from(arg); +TemporalHelpers.assertPlainYearMonth(result2, 2019, 6, "M06", "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-case-insensitive.js index cb9d139626..ccfa48c260 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.PlainYearMonth(2019, 6); const calendar = "IsO8601"; -const arg = { year: 2019, monthCode: "M06", calendar }; -const result = instance.equals(arg); -assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +let arg = { year: 2019, monthCode: "M06", calendar }; +const result1 = instance.equals(arg); +assert.sameValue(result1, true, "Calendar is case-insensitive"); + +arg = { year: 2019, monthCode: "M06", calendar: { calendar } }; +const result2 = instance.equals(arg); +assert.sameValue(result2, true, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-case-insensitive.js index dec89eaee2..0c0d6dbcf4 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainYearMonth(2019, 6); const calendar = "IsO8601"; -const arg = { year: 2019, monthCode: "M06", calendar }; -const result = instance.since(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 2019, monthCode: "M06", calendar }; +const result1 = instance.since(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 2019, monthCode: "M06", calendar: { calendar } }; +const result2 = instance.since(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-case-insensitive.js index 0ad74623a1..bb96364415 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.PlainYearMonth(2019, 6); const calendar = "IsO8601"; -const arg = { year: 2019, monthCode: "M06", calendar }; -const result = instance.until(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 2019, monthCode: "M06", calendar }; +const result1 = instance.until(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 2019, monthCode: "M06", calendar: { calendar } }; +const result2 = instance.until(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-case-insensitive.js index c96b247377..40aa37fe51 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.TimeZone("UTC"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.getInstantFor(arg); -assert.sameValue(result.epochNanoseconds, 217_123_200_000_000_000n, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.getInstantFor(arg); +assert.sameValue(result1.epochNanoseconds, 217_123_200_000_000_000n, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.getInstantFor(arg); +assert.sameValue(result2.epochNanoseconds, 217_123_200_000_000_000n, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-case-insensitive.js b/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-case-insensitive.js index 9fa1a2247f..c7ae3d6e5f 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-case-insensitive.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-case-insensitive.js @@ -9,6 +9,6 @@ features: [Temporal] const instance = new Temporal.TimeZone("UTC"); -const arg = "iSo8601";; +const arg = "iSo8601"; const result = instance.getPlainDateTimeFor(new Temporal.Instant(0n), arg); assert.sameValue(result.calendar.id, "iso8601", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-case-insensitive.js index 61e434ece7..51f74363b3 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.TimeZone("UTC"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.getPossibleInstantsFor(arg); -assert.compareArray(result.map(i => i.epochNanoseconds), [217_123_200_000_000_000n], `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.getPossibleInstantsFor(arg); +assert.compareArray(result1.map(i => i.epochNanoseconds), [217_123_200_000_000_000n], "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.getPossibleInstantsFor(arg); +assert.compareArray(result2.map(i => i.epochNanoseconds), [217_123_200_000_000_000n], "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js new file mode 100644 index 0000000000..bae1a5f2fb --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,25 @@ +// 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.zoneddatetime.compare +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +const calendar = "IsO8601"; + +const timeZone = new Temporal.TimeZone("UTC"); +const datetime = new Temporal.ZonedDateTime(0n, timeZone); + +let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; +const result1 = Temporal.ZonedDateTime.compare(arg, datetime); +assert.sameValue(result1, 0, "Calendar is case-insensitive (first argument)"); +const result2 = Temporal.ZonedDateTime.compare(datetime, arg); +assert.sameValue(result2, 0, "Calendar is case-insensitive (second argument)"); + +arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } }; +const result3 = Temporal.ZonedDateTime.compare(arg, datetime); +assert.sameValue(result3, 0, "Calendar is case-insensitive (nested property, first argument)"); +const result4 = Temporal.ZonedDateTime.compare(datetime, arg); +assert.sameValue(result4, 0, "Calendar is case-insensitive (nested property, second argument)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js index df898dee26..4b270f898a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js @@ -10,6 +10,10 @@ features: [Temporal] const calendar = "IsO8601"; const timeZone = new Temporal.TimeZone("UTC"); -const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; -const result = Temporal.ZonedDateTime.from(arg); -assert.sameValue(result.calendar.id, "iso8601", `Calendar created from string "${calendar}"`); +let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; +const result1 = Temporal.ZonedDateTime.from(arg); +assert.sameValue(result1.calendar.id, "iso8601", "Calendar is case-insensitive"); + +arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } }; +const result2 = Temporal.ZonedDateTime.from(arg); +assert.sameValue(result2.calendar.id, "iso8601", "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js index 2f7cb2c7ea..d571f91a7c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "IsO8601"; -const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; -const result = instance.equals(arg); -assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; +const result1 = instance.equals(arg); +assert.sameValue(result1, true, "Calendar is case-insensitive"); + +arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } }; +const result2 = instance.equals(arg); +assert.sameValue(result2, true, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js index 05a024365d..5925793a6b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -13,6 +13,10 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "IsO8601"; -const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; -const result = instance.since(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; +const result1 = instance.since(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } }; +const result2 = instance.since(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js index e51382f9c9..7d95519d22 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -13,6 +13,10 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "IsO8601"; -const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; -const result = instance.until(arg); -TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; +const result1 = instance.until(arg); +TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive"); + +arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } }; +const result2 = instance.until(arg); +TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Calendar is case-insensitive (nested property)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-case-insensitive.js index ff65a42f69..3320cdc5a8 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-case-insensitive.js @@ -9,6 +9,6 @@ features: [Temporal] const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC", { id: "replace-me" }); -const arg = "IsO8601";; +const arg = "iSo8601"; const result = instance.withCalendar(arg); assert.sameValue(result.calendar.id, "iso8601", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js index efe768386a..dc12a06470 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js @@ -12,6 +12,10 @@ const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.withPlainDate(arg); -assert.sameValue(result.epochNanoseconds, 217_129_600_000_000_000n, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.withPlainDate(arg); +assert.sameValue(result1.epochNanoseconds, 217_129_600_000_000_000n, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.withPlainDate(arg); +assert.sameValue(result2.epochNanoseconds, 217_129_600_000_000_000n, "Calendar is case-insensitive (nested property)"); diff --git a/test/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-case-insensitive.js b/test/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-case-insensitive.js index 3f2e14a44a..e87641d327 100644 --- a/test/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-case-insensitive.js +++ b/test/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.era(arg); -assert.sameValue(result, undefined, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.era(arg); +assert.sameValue(result1, undefined, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.era(arg); +assert.sameValue(result2, undefined, "Calendar is case-insensitive (nested property)"); diff --git a/test/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-case-insensitive.js b/test/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-case-insensitive.js index 17f3a91ded..48f60e1348 100644 --- a/test/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-case-insensitive.js +++ b/test/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-case-insensitive.js @@ -11,6 +11,10 @@ const instance = new Temporal.Calendar("iso8601"); const calendar = "IsO8601"; -const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; -const result = instance.eraYear(arg); -assert.sameValue(result, undefined, `Calendar created from string "${calendar}"`); +let arg = { year: 1976, monthCode: "M11", day: 18, calendar }; +const result1 = instance.eraYear(arg); +assert.sameValue(result1, undefined, "Calendar is case-insensitive"); + +arg = { year: 1976, monthCode: "M11", day: 18, calendar: { calendar } }; +const result2 = instance.eraYear(arg); +assert.sameValue(result2, undefined, "Calendar is case-insensitive (nested property)");