mirror of https://github.com/tc39/test262.git
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:
parent
9671c4a613
commit
e5ef51ba7e
|
@ -10,4 +10,3 @@ features: [Temporal]
|
||||||
const instance = new Temporal.PlainDate(2000, 5, 2);
|
const instance = new Temporal.PlainDate(2000, 5, 2);
|
||||||
assert.sameValue(instance.equals("2000-05-02"), true, "same date");
|
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-04"), false, "different date");
|
||||||
assert.sameValue(instance.equals("2000-05-02[u-ca=gregory]"), false, "different calendar");
|
|
||||||
|
|
|
@ -23,9 +23,3 @@ const options = TemporalHelpers.propertyBagObserver(actual, { disambiguation: "c
|
||||||
instance.toZonedDateTime("UTC", options);
|
instance.toZonedDateTime("UTC", options);
|
||||||
assert.compareArray(actual, expected, "order of operations");
|
assert.compareArray(actual, expected, "order of operations");
|
||||||
actual.splice(0); // clear
|
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
|
|
||||||
|
|
|
@ -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");
|
|
@ -4,7 +4,6 @@
|
||||||
/*---
|
/*---
|
||||||
esid: sec-temporal.plaindatetime.compare
|
esid: sec-temporal.plaindatetime.compare
|
||||||
description: Calendar is not taken into account for the comparison.
|
description: Calendar is not taken into account for the comparison.
|
||||||
includes: [temporalHelpers.js]
|
|
||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
/*---
|
/*---
|
||||||
esid: sec-temporal.plaindatetime.prototype.equals
|
esid: sec-temporal.plaindatetime.prototype.equals
|
||||||
description: Calendar is taken into account if the ISO data is equal
|
description: Calendar is taken into account if the ISO data is equal
|
||||||
includes: [compareArray.js,temporalHelpers.js]
|
|
||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
25
test/intl402/Temporal/PlainDateTime/prototype/toZonedDateTime/order-of-operations.js
vendored
Normal file
25
test/intl402/Temporal/PlainDateTime/prototype/toZonedDateTime/order-of-operations.js
vendored
Normal 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
|
|
@ -4,7 +4,6 @@
|
||||||
/*---
|
/*---
|
||||||
esid: sec-temporal.plainmonthday.prototype.equals
|
esid: sec-temporal.plainmonthday.prototype.equals
|
||||||
description: Basic tests for equals() calendar handling
|
description: Basic tests for equals() calendar handling
|
||||||
includes: [compareArray.js, temporalHelpers.js]
|
|
||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
/*---
|
/*---
|
||||||
esid: sec-temporal.plainyearmonth.prototype.equals
|
esid: sec-temporal.plainyearmonth.prototype.equals
|
||||||
description: equals() takes the calendar into account
|
description: equals() takes the calendar into account
|
||||||
includes: [compareArray.js, temporalHelpers.js]
|
|
||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
Loading…
Reference in New Issue