From 0df97508ffd8f84b253751cbed1cfbee387fe0bc Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 28 Nov 2025 17:27:32 -0800 Subject: [PATCH] Temporal: Test that "islamic" and "islamic-rgsa" calendars are unsupported And remove the equivalent staging tests. --- .../Temporal/PlainDate/from/islamic-rgsa.js | 15 +++++++++++++++ test/intl402/Temporal/PlainDate/from/islamic.js | 15 +++++++++++++++ .../Temporal/PlainDateTime/from/islamic-rgsa.js | 15 +++++++++++++++ .../Temporal/PlainDateTime/from/islamic.js | 15 +++++++++++++++ .../Temporal/PlainMonthDay/from/islamic-rgsa.js | 15 +++++++++++++++ .../Temporal/PlainMonthDay/from/islamic.js | 15 +++++++++++++++ .../Temporal/PlainYearMonth/from/islamic-rgsa.js | 15 +++++++++++++++ .../Temporal/PlainYearMonth/from/islamic.js | 15 +++++++++++++++ .../Temporal/ZonedDateTime/from/islamic-rgsa.js | 15 +++++++++++++++ .../Temporal/ZonedDateTime/from/islamic.js | 15 +++++++++++++++ .../old/islamic-calendars-islamic-rgsa.js | 12 ------------ .../Temporal/old/islamic-calendars-islamic.js | 12 ------------ 12 files changed, 150 insertions(+), 24 deletions(-) create mode 100644 test/intl402/Temporal/PlainDate/from/islamic-rgsa.js create mode 100644 test/intl402/Temporal/PlainDate/from/islamic.js create mode 100644 test/intl402/Temporal/PlainDateTime/from/islamic-rgsa.js create mode 100644 test/intl402/Temporal/PlainDateTime/from/islamic.js create mode 100644 test/intl402/Temporal/PlainMonthDay/from/islamic-rgsa.js create mode 100644 test/intl402/Temporal/PlainMonthDay/from/islamic.js create mode 100644 test/intl402/Temporal/PlainYearMonth/from/islamic-rgsa.js create mode 100644 test/intl402/Temporal/PlainYearMonth/from/islamic.js create mode 100644 test/intl402/Temporal/ZonedDateTime/from/islamic-rgsa.js create mode 100644 test/intl402/Temporal/ZonedDateTime/from/islamic.js delete mode 100644 test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js delete mode 100644 test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js diff --git a/test/intl402/Temporal/PlainDate/from/islamic-rgsa.js b/test/intl402/Temporal/PlainDate/from/islamic-rgsa.js new file mode 100644 index 0000000000..b8092e0cfc --- /dev/null +++ b/test/intl402/Temporal/PlainDate/from/islamic-rgsa.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic-rgsa" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic-rgsa"; + +assert.throws(RangeError, () => + Temporal.PlainDate.from({year: 1500, month: 1, day: 1, calendar}), + "fallback for calendar ID 'islamic-rgsa' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/PlainDate/from/islamic.js b/test/intl402/Temporal/PlainDate/from/islamic.js new file mode 100644 index 0000000000..58c6de8f6e --- /dev/null +++ b/test/intl402/Temporal/PlainDate/from/islamic.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic"; + +assert.throws(RangeError, () => + Temporal.PlainDate.from({year: 1500, month: 1, day: 1, calendar}), + "fallback for calendar ID 'islamic' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/PlainDateTime/from/islamic-rgsa.js b/test/intl402/Temporal/PlainDateTime/from/islamic-rgsa.js new file mode 100644 index 0000000000..50ebc1b1c0 --- /dev/null +++ b/test/intl402/Temporal/PlainDateTime/from/islamic-rgsa.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic-rgsa" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic-rgsa"; + +assert.throws(RangeError, () => + Temporal.PlainDateTime.from({year: 1500, month: 1, day: 1, hour: 12, minute: 34, calendar}), + "fallback for calendar ID 'islamic-rgsa' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/PlainDateTime/from/islamic.js b/test/intl402/Temporal/PlainDateTime/from/islamic.js new file mode 100644 index 0000000000..6265894cce --- /dev/null +++ b/test/intl402/Temporal/PlainDateTime/from/islamic.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic"; + +assert.throws(RangeError, () => + Temporal.PlainDateTime.from({year: 1500, month: 1, day: 1, calendar}), + "fallback for calendar ID 'islamic' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/PlainMonthDay/from/islamic-rgsa.js b/test/intl402/Temporal/PlainMonthDay/from/islamic-rgsa.js new file mode 100644 index 0000000000..8790f567a8 --- /dev/null +++ b/test/intl402/Temporal/PlainMonthDay/from/islamic-rgsa.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic-rgsa" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic-rgsa"; + +assert.throws(RangeError, () => + Temporal.PlainMonthDay.from({month: 1, day: 1, calendar}), + "fallback for calendar ID 'islamic-rgsa' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/PlainMonthDay/from/islamic.js b/test/intl402/Temporal/PlainMonthDay/from/islamic.js new file mode 100644 index 0000000000..72ea4e62c6 --- /dev/null +++ b/test/intl402/Temporal/PlainMonthDay/from/islamic.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic"; + +assert.throws(RangeError, () => + Temporal.PlainMonthDay.from({year: 1500, month: 1, day: 1, calendar}), + "fallback for calendar ID 'islamic' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/PlainYearMonth/from/islamic-rgsa.js b/test/intl402/Temporal/PlainYearMonth/from/islamic-rgsa.js new file mode 100644 index 0000000000..b8018a2a7f --- /dev/null +++ b/test/intl402/Temporal/PlainYearMonth/from/islamic-rgsa.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic-rgsa" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic-rgsa"; + +assert.throws(RangeError, () => + Temporal.PlainYearMonth.from({year: 1500, month: 1, calendar}), + "fallback for calendar ID 'islamic-rgsa' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/PlainYearMonth/from/islamic.js b/test/intl402/Temporal/PlainYearMonth/from/islamic.js new file mode 100644 index 0000000000..04d0611b22 --- /dev/null +++ b/test/intl402/Temporal/PlainYearMonth/from/islamic.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic"; + +assert.throws(RangeError, () => + Temporal.PlainYearMonth.from({year: 1500, month: 1, day: 1, calendar}), + "fallback for calendar ID 'islamic' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/ZonedDateTime/from/islamic-rgsa.js b/test/intl402/Temporal/ZonedDateTime/from/islamic-rgsa.js new file mode 100644 index 0000000000..e2c814c9c4 --- /dev/null +++ b/test/intl402/Temporal/ZonedDateTime/from/islamic-rgsa.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic-rgsa" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic-rgsa"; + +assert.throws(RangeError, () => + Temporal.ZonedDateTime.from({year: 1500, month: 1, day: 1, hour: 12, minute: 34, timeZone: "UTC", calendar}), + "fallback for calendar ID 'islamic-rgsa' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/intl402/Temporal/ZonedDateTime/from/islamic.js b/test/intl402/Temporal/ZonedDateTime/from/islamic.js new file mode 100644 index 0000000000..05b38c64c7 --- /dev/null +++ b/test/intl402/Temporal/ZonedDateTime/from/islamic.js @@ -0,0 +1,15 @@ +// Copyright (C) 2025 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: "islamic" calendar name is not supported +features: [Temporal, Intl.Era-monthcode] +---*/ + +const calendar = "islamic"; + +assert.throws(RangeError, () => + Temporal.ZonedDateTime.from({year: 1500, month: 1, day: 1, calendar}), + "fallback for calendar ID 'islamic' only supported in Intl.DateTimeFormat constructor, not Temporal" +); diff --git a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js deleted file mode 100644 index 62b19c88de..0000000000 --- a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic-rgsa.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2023 Justin Grant. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal-intl -description: Islamic calendar "islamic-rgsa". -features: [Temporal] ----*/ - -assert.throws(RangeError, function () { - Temporal.PlainDate.from({ year: 1500, month: 1, day: 1, calendar: "islamic-rgsa" }); -}, "fallback for calendar ID 'islamic-rgsa' only supported in Intl.DateTimeFormat constructor, not Temporal"); diff --git a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js b/test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js deleted file mode 100644 index b34372c5a9..0000000000 --- a/test/staging/Intl402/Temporal/old/islamic-calendars-islamic.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2023 Justin Grant. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal-intl -description: Islamic calendar "islamic". -features: [Temporal] ----*/ - -assert.throws(RangeError, function () { - Temporal.PlainDate.from({ year: 1500, month: 1, day: 1, calendar: "islamic" }); -}, "fallback for calendar ID 'islamic' only supported in Intl.DateTimeFormat constructor, not Temporal");