diff --git a/test/built-ins/Temporal/Calendar/from/calendar-case-insensitive.js b/test/built-ins/Temporal/Calendar/from/calendar-case-insensitive.js new file mode 100644 index 0000000000..c31020a8b7 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/from/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.from +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = Temporal.Calendar.from(arg); +assert.sameValue(result.id, "japanese", "Calendar is case-insensitive"); 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 new file mode 100644 index 0000000000..a2abea1820 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.dateadd +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..818bfa4b36 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.day +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..33aec65e06 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.dayofweek +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..90d94eae52 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.dayofyear +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..ea94de6225 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.daysinmonth +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..a938b2a910 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.daysinweek +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..bbee13e512 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.daysinyear +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..49f8b41825 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.inleapyear +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..7314b5f0b8 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.month +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..6ea4441c83 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.monthcode +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..90a33288ce --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.monthsinyear +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..0927a1a430 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.weekofyear +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..dacab7db74 --- /dev/null +++ b/test/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.year +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..1cb96e3c66 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-case-insensitive.js @@ -0,0 +1,14 @@ +// 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.instant.prototype.tozoneddatetime +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.Instant(1_000_000_000_000_000_000n); + +const arg = "jApAnEsE";; +const result = instance.toZonedDateTime({ calendar: arg, timeZone: "UTC" }); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/Now/plainDate/calendar-case-insensitive.js b/test/built-ins/Temporal/Now/plainDate/calendar-case-insensitive.js new file mode 100644 index 0000000000..9ba3be014f --- /dev/null +++ b/test/built-ins/Temporal/Now/plainDate/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.now.prototype.plaindate +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = Temporal.Now.plainDate(arg); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/Now/plainDateTime/calendar-case-insensitive.js b/test/built-ins/Temporal/Now/plainDateTime/calendar-case-insensitive.js new file mode 100644 index 0000000000..e3599cc28a --- /dev/null +++ b/test/built-ins/Temporal/Now/plainDateTime/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.now.prototype.plaindatetime +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = Temporal.Now.plainDateTime(arg); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/Now/zonedDateTime/calendar-case-insensitive.js b/test/built-ins/Temporal/Now/zonedDateTime/calendar-case-insensitive.js new file mode 100644 index 0000000000..f314c9a757 --- /dev/null +++ b/test/built-ins/Temporal/Now/zonedDateTime/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.now.prototype.zoneddatetime +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = Temporal.Now.zonedDateTime(arg); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/PlainDate/calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDate/calendar-case-insensitive.js new file mode 100644 index 0000000000..298b706c9e --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.prototype.constructor +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = new Temporal.PlainDate(2000, 5, 2, arg); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); 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 new file mode 100644 index 0000000000..eb1159dc0d --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,15 @@ +// 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.prototype.from +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +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}"`); \ No newline at end of file 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 new file mode 100644 index 0000000000..1913409488 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.prototype.equals +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..617fa439c3 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.prototype.since +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..3cddfb4546 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.prototype.until +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..f98ac8611c --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-case-insensitive.js @@ -0,0 +1,14 @@ +// 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.prototype.withcalendar +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDate(1976, 11, 18, { id: "replace-me" }); + +const arg = "jApAnEsE";; +const result = instance.withCalendar(arg); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/PlainDateTime/calendar-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/calendar-case-insensitive.js new file mode 100644 index 0000000000..b8bb312ef5 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.prototype.constructor +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = new Temporal.PlainDateTime(2000, 5, 2, 15, 23, 30, 987, 654, 321, arg); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); 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 new file mode 100644 index 0000000000..ef4c0770d9 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,15 @@ +// 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.prototype.from +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +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}"`); \ No newline at end of file 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 new file mode 100644 index 0000000000..6bde0037fd --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.prototype.equals +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..01824a81cc --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.prototype.since +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..f07d2cb61c --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.prototype.until +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..c731bcb3e3 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-case-insensitive.js @@ -0,0 +1,14 @@ +// 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.prototype.withcalendar +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, { id: "replace-me" }); + +const arg = "jApAnEsE";; +const result = instance.withCalendar(arg); +assert.sameValue(result.calendar.id, "japanese", "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 new file mode 100644 index 0000000000..aae3d153b6 --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.prototype.withplaindate +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); + +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}"`); diff --git a/test/built-ins/Temporal/PlainMonthDay/calendar-case-insensitive.js b/test/built-ins/Temporal/PlainMonthDay/calendar-case-insensitive.js new file mode 100644 index 0000000000..ffb4ba82d6 --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.plainmonthday.prototype.constructor +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = new Temporal.PlainMonthDay(12, 15, arg, 1972); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); 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 new file mode 100644 index 0000000000..5ccfbc6ad3 --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,15 @@ +// 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.plainmonthday.prototype.from +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +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}"`); \ No newline at end of file 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 new file mode 100644 index 0000000000..b7b355879a --- /dev/null +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.plainmonthday.prototype.equals +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..8ae9de839e --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.plaintime.prototype.toplaindatetime +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..e439eb627f --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.plaintime.prototype.tozoneddatetime +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); diff --git a/test/built-ins/Temporal/PlainYearMonth/calendar-case-insensitive.js b/test/built-ins/Temporal/PlainYearMonth/calendar-case-insensitive.js new file mode 100644 index 0000000000..2ae1fee560 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.constructor +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = new Temporal.PlainYearMonth(2000, 5, arg, 1); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); 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 new file mode 100644 index 0000000000..5f7b14ba1a --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,15 @@ +// 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.from +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +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}"`); \ No newline at end of file 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 new file mode 100644 index 0000000000..cb9d139626 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.equals +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..dec89eaee2 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.since +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..0ad74623a1 --- /dev/null +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..c96b247377 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.timezone.prototype.getinstantfor +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..e9071463ee --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-case-insensitive.js @@ -0,0 +1,14 @@ +// 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.timezone.prototype.getplaindatetimefor +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.TimeZone("UTC"); + +const arg = "jApAnEsE";; +const result = instance.getPlainDateTimeFor(new Temporal.Instant(0n), arg); +assert.sameValue(result.calendar.id, "japanese", "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 new file mode 100644 index 0000000000..61e434ece7 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.timezone.prototype.getpossibleinstantsfor +description: The calendar name is case-insensitive +includes: [compareArray.js] +features: [Temporal] +---*/ + +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}"`); diff --git a/test/built-ins/Temporal/ZonedDateTime/calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/calendar-case-insensitive.js new file mode 100644 index 0000000000..d4d6cdbba5 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/calendar-case-insensitive.js @@ -0,0 +1,13 @@ +// 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.prototype.constructor +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const arg = "jApAnEsE"; + +const result = new Temporal.ZonedDateTime(0n, "UTC", arg); +assert.sameValue(result.calendar.id, "japanese", "Calendar is case-insensitive"); 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 new file mode 100644 index 0000000000..135b340259 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,15 @@ +// 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.prototype.from +description: The calendar name is case-insensitive +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}"`); \ No newline at end of file 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 new file mode 100644 index 0000000000..2f7cb2c7ea --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.prototype.equals +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +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}"`); 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 new file mode 100644 index 0000000000..05a024365d --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,18 @@ +// 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.prototype.since +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +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}"`); 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 new file mode 100644 index 0000000000..e51382f9c9 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,18 @@ +// 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.prototype.until +description: The calendar name is case-insensitive +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +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}"`); 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 new file mode 100644 index 0000000000..ef0fc6bb7a --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-case-insensitive.js @@ -0,0 +1,14 @@ +// 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.prototype.withcalendar +description: Calendar names are case-insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC", { id: "replace-me" }); + +const arg = "jApAnEsE";; +const result = instance.withCalendar(arg); +assert.sameValue(result.calendar.id, "japanese", "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 new file mode 100644 index 0000000000..efe768386a --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,17 @@ +// 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.prototype.withplaindate +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +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}"`); 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 new file mode 100644 index 0000000000..3f2e14a44a --- /dev/null +++ b/test/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.era +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`); 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 new file mode 100644 index 0000000000..17f3a91ded --- /dev/null +++ b/test/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-case-insensitive.js @@ -0,0 +1,16 @@ +// 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.erayear +description: The calendar name is case-insensitive +features: [Temporal] +---*/ + +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}"`);