From d7181a58662ee4cecd8a5c84b28a6c916090710e Mon Sep 17 00:00:00 2001 From: Aditi Date: Wed, 7 Sep 2022 14:38:19 +0530 Subject: [PATCH] Add timezone case insensitive tests --- .../toZonedDateTime/timezone-case-insensitive.js | 14 ++++++++++++++ .../timezone-case-insensitive.js | 14 ++++++++++++++ .../Now/zonedDateTime/timezone-case-insensitive.js | 12 ++++++++++++ .../zonedDateTimeISO/timezone-case-insensitive.js | 12 ++++++++++++ ...gument-propertybag-calendar-case-insensitive.js | 2 +- .../toZonedDateTime/timezone-case-insensitive.js | 14 ++++++++++++++ ...gument-propertybag-calendar-case-insensitive.js | 2 +- .../toZonedDateTime/timezone-case-insensitive.js | 14 ++++++++++++++ ...gument-propertybag-calendar-case-insensitive.js | 2 +- .../toZonedDateTime/timezone-case-insensitive.js | 14 ++++++++++++++ ...gument-propertybag-calendar-case-insensitive.js | 2 +- .../TimeZone/from/timezone-case-insensitive.js | 12 ++++++++++++ ...gument-propertybag-calendar-case-insensitive.js | 2 +- .../from/timezone-case-insensitive.js | 12 ++++++++++++ .../withTimeZone/timezone-case-insensitive.js | 14 ++++++++++++++ .../ZonedDateTime/timezone-case-insensitive.js | 12 ++++++++++++ 16 files changed, 149 insertions(+), 5 deletions(-) create mode 100644 test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/Now/zonedDateTime/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/TimeZone/from/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/ZonedDateTime/from/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-case-insensitive.js create mode 100644 test/built-ins/Temporal/ZonedDateTime/timezone-case-insensitive.js diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-case-insensitive.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-case-insensitive.js new file mode 100644 index 0000000000..ff123031d2 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-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: Time zone names are case insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.Instant(0n); + +const timeZone = 'eTc/gMt+1'; +const result = instance.toZonedDateTime({ timeZone, calendar: "iso8601" }); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-case-insensitive.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-case-insensitive.js new file mode 100644 index 0000000000..2d11d1c612 --- /dev/null +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-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.tozoneddatetimeiso +description: Time zone names are case insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.Instant(0n); + +const timeZone = 'eTc/gMt+1'; +const result = instance.toZonedDateTimeISO(timeZone); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); diff --git a/test/built-ins/Temporal/Now/zonedDateTime/timezone-case-insensitive.js b/test/built-ins/Temporal/Now/zonedDateTime/timezone-case-insensitive.js new file mode 100644 index 0000000000..e80ec304b7 --- /dev/null +++ b/test/built-ins/Temporal/Now/zonedDateTime/timezone-case-insensitive.js @@ -0,0 +1,12 @@ +// 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: Time zone names are case insensitive +features: [Temporal] +---*/ + +const timeZone = 'eTc/gMt+1'; +const result = Temporal.Now.zonedDateTime("iso8601", timeZone); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); diff --git a/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-case-insensitive.js b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-case-insensitive.js new file mode 100644 index 0000000000..845c25d379 --- /dev/null +++ b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-case-insensitive.js @@ -0,0 +1,12 @@ +// 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.zoneddatetimeiso +description: Time zone names are case insensitive +features: [Temporal] +---*/ + +const timeZone = 'eTc/gMt+1'; +const result = Temporal.Now.zonedDateTimeISO(timeZone); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); 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 eb1159dc0d..25c986f9e0 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 @@ -12,4 +12,4 @@ 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 +TemporalHelpers.assertPlainDate(result, 1976, 11, "M11", 18, `Calendar created from string "${calendar}"`); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-case-insensitive.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-case-insensitive.js new file mode 100644 index 0000000000..74673a9d3d --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-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.tozoneddatetime +description: Time zone names are case insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDate(2000, 5, 2); + +const timeZone = 'eTc/gMt+1'; +const result = instance.toZonedDateTime(timeZone); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); 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 ef4c0770d9..1a437b8b86 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 @@ -12,4 +12,4 @@ 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 +TemporalHelpers.assertPlainDateTime(result, 1976, 11, "M11", 18, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-case-insensitive.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-case-insensitive.js new file mode 100644 index 0000000000..ce432b3a9d --- /dev/null +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-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.tozoneddatetime +description: Time zone names are case insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(2000, 5, 2); + +const timeZone = 'eTc/gMt+1'; +const result = instance.toZonedDateTime(timeZone); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); 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 5ccfbc6ad3..29821c6661 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 @@ -12,4 +12,4 @@ 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 +TemporalHelpers.assertPlainMonthDay(result, "M11", 18, `Calendar created from string "${calendar}"`); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-case-insensitive.js b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-case-insensitive.js new file mode 100644 index 0000000000..06b72af8db --- /dev/null +++ b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-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.plaintime.prototype.tozoneddatetime +description: Time zone names are case insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.PlainTime(); + +const timeZone = 'eTc/gMt+1'; +const result = instance.toZonedDateTime({ plainDate: new Temporal.PlainDate(2000, 5, 2), timeZone }); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); 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 5f7b14ba1a..48b9a27da9 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 @@ -12,4 +12,4 @@ 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 +TemporalHelpers.assertPlainYearMonth(result, 2019, 6, "M06", `Calendar created from string "${calendar}"`); diff --git a/test/built-ins/Temporal/TimeZone/from/timezone-case-insensitive.js b/test/built-ins/Temporal/TimeZone/from/timezone-case-insensitive.js new file mode 100644 index 0000000000..6a3be77d83 --- /dev/null +++ b/test/built-ins/Temporal/TimeZone/from/timezone-case-insensitive.js @@ -0,0 +1,12 @@ +// 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.from +description: Time zone names are case insensitive +features: [Temporal] +---*/ + +const timeZone = 'eTc/gMt+1'; +const result = Temporal.TimeZone.from(timeZone); +assert.sameValue(result.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); 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 135b340259..fbc576c6af 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 @@ -12,4 +12,4 @@ 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 +assert.sameValue(result.calendar.id, "iso8601", `Calendar created from string "${calendar}"`); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/timezone-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/from/timezone-case-insensitive.js new file mode 100644 index 0000000000..3741ade627 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/from/timezone-case-insensitive.js @@ -0,0 +1,12 @@ +// 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: Time zone names are case insensitive +features: [Temporal] +---*/ + +const timeZone = 'eTc/gMt+1'; +const result = Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone }); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-case-insensitive.js new file mode 100644 index 0000000000..286f7ba963 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-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.withtimezone +description: Time zone names are case insensitive +features: [Temporal] +---*/ + +const instance = new Temporal.ZonedDateTime(0n, "UTC"); + +const timeZone = 'eTc/gMt+1'; +const result = instance.withTimeZone(timeZone); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`); diff --git a/test/built-ins/Temporal/ZonedDateTime/timezone-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/timezone-case-insensitive.js new file mode 100644 index 0000000000..be53f71ce7 --- /dev/null +++ b/test/built-ins/Temporal/ZonedDateTime/timezone-case-insensitive.js @@ -0,0 +1,12 @@ +// 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: Time zone names are case insensitive +features: [Temporal] +---*/ + +const timeZone = 'eTc/gMt+1'; +const result = new Temporal.ZonedDateTime(0n, timeZone); +assert.sameValue(result.timeZone.id, 'Etc/GMT+1', `Time zone created from string "${timeZone}"`);