mirror of https://github.com/tc39/test262.git
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:
parent
5c629683f2
commit
8bc3dbb234
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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})");
|
||||
}
|
||||
|
|
|
@ -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");
|
12
test/intl402/Temporal/PlainMonthDay/prototype/with/fields-missing-properties.js
vendored
Normal file
12
test/intl402/Temporal/PlainMonthDay/prototype/with/fields-missing-properties.js
vendored
Normal 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})");
|
Loading…
Reference in New Issue