Temporal: Move non-ISO calendar tests to intl402/

We'll do this for now, then separately work on migrating all of the tests
that require a non-ISO8601 calendar but aren't dependent on it being any
particular calendar.
This commit is contained in:
Philip Chimento 2023-09-19 10:04:21 -07:00 committed by Richard Gibson
parent 5c629683f2
commit 8bc3dbb234
5 changed files with 24 additions and 17 deletions

View File

@ -9,11 +9,6 @@ features: [Symbol.species, Symbol.iterator, Temporal]
const ASCII_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/u;
let nonDefaultCalendarId = undefined;
try {
nonDefaultCalendarId = Temporal.Calendar.from("hebrew").id;
} catch (err) {}
function formatPropertyName(propertyKey, objectName = "") {
switch (typeof propertyKey) {
case "symbol":
@ -41,8 +36,6 @@ function formatPropertyName(propertyKey, objectName = "") {
const SKIP_SYMBOL = Symbol("Skip");
var TemporalHelpers = {
nonDefaultCalendarId,
/*
* Codes and maximum lengths of months in the ISO 8601 calendar.
*/

View File

@ -4,7 +4,6 @@
/*---
esid: sec-temporal.plainmonthday.from
description: Basic tests for PlainMonthDay.from(object) with missing properties.
includes: [temporalHelpers.js]
features: [Temporal]
---*/
@ -13,7 +12,3 @@ assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ day: 15 }), "Only d
assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ monthCode: 'M12' }), "Only monthCode");
assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ monthCode: undefined, day: 15 }), "monthCode undefined");
assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ months: 12, day: 31 }), "months plural");
if (TemporalHelpers.nonDefaultCalendarId) {
assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ month: 11, day: 18, calendar: TemporalHelpers.nonDefaultCalendarId }), "month, day with non-iso8601 calendar");
}

View File

@ -39,8 +39,3 @@ assert.throws(TypeError, () => md.with({ months: 12 }), "with({months})");
TemporalHelpers.assertPlainMonthDay(md.with({ monthCode: "M12", days: 1 }),
"M12", 15, "with({monthCode, days})");
if (TemporalHelpers.nonDefaultCalendarId) {
const calendarMonthDay = Temporal.PlainMonthDay.from({ year: 2021, month: 1, day: 15, calendar: TemporalHelpers.nonDefaultCalendarId });
assert.throws(TypeError, () => calendarMonthDay.with({ month: 12 }), "nonIso8601MonthDay.with({month})");
}

View File

@ -0,0 +1,12 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainmonthday.from
description: >
Basic tests for PlainMonthDay.from(object) with missing properties for non-ISO
calendars
features: [Temporal]
---*/
assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ month: 11, day: 18, calendar: "gregory" }), "month, day with non-iso8601 calendar");

View File

@ -0,0 +1,12 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plainmonthday.prototype.with
description: >
Basic tests for with(object) with missing properties for non-ISO calendars
features: [Temporal]
---*/
const calendarMonthDay = Temporal.PlainMonthDay.from({ year: 2021, month: 1, day: 15, calendar: "gregory" });
assert.throws(TypeError, () => calendarMonthDay.with({ month: 12 }), "nonIso8601MonthDay.with({month})");