Temporal: Move tests into intl402/ that require non-ISO calendar or non-UTC time zone

Without custom calendars and time zones there are actually a bunch of
things that we now can't test on implementations that don't have non-ISO
calendars or non-UTC time zones. (Alternatively, we can say that these are
functionalities that those implementations don't have to implement.)
This commit is contained in:
Philip Chimento 2024-06-04 13:56:03 +02:00 committed by Ms2ger
parent 9671c4a613
commit e5ef51ba7e
31 changed files with 36 additions and 11 deletions

View File

@ -10,4 +10,3 @@ features: [Temporal]
const instance = new Temporal.PlainDate(2000, 5, 2);
assert.sameValue(instance.equals("2000-05-02"), true, "same date");
assert.sameValue(instance.equals("2000-05-04"), false, "different date");
assert.sameValue(instance.equals("2000-05-02[u-ca=gregory]"), false, "different calendar");

View File

@ -23,9 +23,3 @@ const options = TemporalHelpers.propertyBagObserver(actual, { disambiguation: "c
instance.toZonedDateTime("UTC", options);
assert.compareArray(actual, expected, "order of operations");
actual.splice(0); // clear
const rejectInstance = new Temporal.PlainDateTime(2000, 4, 2, 2, 30);
const rejectOptions = TemporalHelpers.propertyBagObserver(actual, { disambiguation: "reject" }, "options");
assert.throws(RangeError, () => rejectInstance.toZonedDateTime("America/Vancouver", rejectOptions));
assert.compareArray(actual, expected, "order of operations with disambiguation: reject");
actual.splice(0); // clear

View File

@ -0,0 +1,11 @@
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.plaindate.prototype.equals
description: equals with a valid string (non-ISO calendar)
features: [Temporal]
---*/
const instance = new Temporal.PlainDate(2000, 5, 2);
assert.sameValue(instance.equals("2000-05-02[u-ca=gregory]"), false, "different calendar");

View File

@ -4,7 +4,6 @@
/*---
esid: sec-temporal.plaindatetime.compare
description: Calendar is not taken into account for the comparison.
includes: [temporalHelpers.js]
features: [Temporal]
---*/

View File

@ -4,7 +4,6 @@
/*---
esid: sec-temporal.plaindatetime.prototype.equals
description: Calendar is taken into account if the ISO data is equal
includes: [compareArray.js,temporalHelpers.js]
features: [Temporal]
---*/

View File

@ -0,0 +1,25 @@
// 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: >
Properties on an object passed to toZonedDateTime() are accessed in the
correct order (with disambiguation=reject)
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
---*/
const expected = [
// ToTemporalDisambiguation
"get options.disambiguation",
"get options.disambiguation.toString",
"call options.disambiguation.toString",
];
const actual = [];
const instance = new Temporal.PlainDateTime(2000, 4, 2, 2, 30);
const options = TemporalHelpers.propertyBagObserver(actual, { disambiguation: "reject" }, "options");
assert.throws(RangeError, () => instance.toZonedDateTime("America/Vancouver", options));
assert.compareArray(actual, expected, "order of operations with disambiguation: reject");
actual.splice(0); // clear

View File

@ -4,7 +4,6 @@
/*---
esid: sec-temporal.plainmonthday.prototype.equals
description: Basic tests for equals() calendar handling
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
---*/

View File

@ -4,7 +4,6 @@
/*---
esid: sec-temporal.plainyearmonth.prototype.equals
description: equals() takes the calendar into account
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
---*/