Temporal: Test that "islamic" and "islamic-rgsa" calendars are unsupported

And remove the equivalent staging tests.
This commit is contained in:
Tim Chevalier 2025-11-28 17:27:32 -08:00 committed by Philip Chimento
parent d2e25dcadc
commit 0df97508ff
12 changed files with 150 additions and 24 deletions

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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"
);

View File

@ -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");

View File

@ -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");