mirror of https://github.com/tc39/test262.git
Update Temporal test262 as per the normative changes
This commit is contained in:
parent
09f863d8c3
commit
e1048d0aff
|
@ -14,9 +14,6 @@ TemporalHelpers.assertPlainDate(new Temporal.PlainDate(2020.6, 11.7, 24.1),
|
|||
TemporalHelpers.assertPlainDate(new Temporal.PlainDate(-2020.6, 11.7, 24.1),
|
||||
-2020, 11, "M11", 24, "negative fractional");
|
||||
|
||||
TemporalHelpers.assertPlainDate(new Temporal.PlainDate(undefined, 11, 24),
|
||||
0, 11, "M11", 24, "undefined");
|
||||
|
||||
TemporalHelpers.assertPlainDate(new Temporal.PlainDate(null, 11, 24),
|
||||
0, 11, "M11", 24, "null");
|
||||
|
||||
|
@ -26,15 +23,17 @@ TemporalHelpers.assertPlainDate(new Temporal.PlainDate(true, 11, 24),
|
|||
TemporalHelpers.assertPlainDate(new Temporal.PlainDate("2020.6", "11.7", "24.1"),
|
||||
2020, 11, "M11", 24, "fractional strings");
|
||||
|
||||
TemporalHelpers.assertPlainDate(new Temporal.PlainDate("invalid", 11, 24),
|
||||
0, 11, "M11", 24, "invalid string");
|
||||
|
||||
for (const invalid of [Symbol(), 1n]) {
|
||||
assert.throws(TypeError, () => new Temporal.PlainDate(invalid, 11, 24), `year ${typeof invalid}`);
|
||||
assert.throws(TypeError, () => new Temporal.PlainDate(2020, invalid, 24), `month ${typeof invalid}`);
|
||||
assert.throws(TypeError, () => new Temporal.PlainDate(2020, 11, invalid), `day ${typeof invalid}`);
|
||||
}
|
||||
|
||||
for (const invalid of [undefined, "invalid"]) {
|
||||
assert.throws(RangeError, () => new Temporal.PlainDate(invalid, 11, 24), `year ${typeof invalid}`);
|
||||
assert.throws(RangeError, () => new Temporal.PlainDate(2020, invalid, 24), `month ${typeof invalid}`);
|
||||
assert.throws(RangeError, () => new Temporal.PlainDate(2020, 11, invalid), `day ${typeof invalid}`);
|
||||
}
|
||||
const actual = [];
|
||||
const args = [
|
||||
TemporalHelpers.toPrimitiveObserver(actual, 2020, "year"),
|
||||
|
|
|
@ -13,6 +13,9 @@ const badResults = [
|
|||
[-Infinity, RangeError],
|
||||
[Symbol("foo"), TypeError],
|
||||
[7n, TypeError],
|
||||
[NaN, RangeError],
|
||||
["string", RangeError],
|
||||
[{}, RangeError],
|
||||
];
|
||||
|
||||
badResults.forEach(([result, error]) => {
|
||||
|
@ -32,11 +35,8 @@ const convertedResults = [
|
|||
[7.1, 7],
|
||||
[-7, -7],
|
||||
[-0.1, 0],
|
||||
[NaN, 0],
|
||||
["string", 0],
|
||||
["7", 7],
|
||||
["7.5", 7],
|
||||
[{}, 0],
|
||||
[{valueOf() { return 7; }}, 7],
|
||||
];
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ const badResults = [
|
|||
[-Infinity, RangeError],
|
||||
[Symbol("foo"), TypeError],
|
||||
[7n, TypeError],
|
||||
[NaN, RangeError],
|
||||
["string", RangeError],
|
||||
[{}, RangeError],
|
||||
];
|
||||
|
||||
badResults.forEach(([result, error]) => {
|
||||
|
@ -32,11 +35,8 @@ const convertedResults = [
|
|||
[7.1, 7],
|
||||
[-7, -7],
|
||||
[-0.1, 0],
|
||||
[NaN, 0],
|
||||
["string", 0],
|
||||
["7", 7],
|
||||
["7.5", 7],
|
||||
[{}, 0],
|
||||
[{valueOf() { return 7; }}, 7],
|
||||
];
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ const badResults = [
|
|||
[-Infinity, RangeError],
|
||||
[Symbol("foo"), TypeError],
|
||||
[7n, TypeError],
|
||||
[NaN, RangeError],
|
||||
["string", RangeError],
|
||||
[{}, RangeError],
|
||||
];
|
||||
|
||||
badResults.forEach(([result, error]) => {
|
||||
|
@ -32,11 +35,8 @@ const convertedResults = [
|
|||
[7.1, 7],
|
||||
[-7, -7],
|
||||
[-0.1, 0],
|
||||
[NaN, 0],
|
||||
["string", 0],
|
||||
["7", 7],
|
||||
["7.5", 7],
|
||||
[{}, 0],
|
||||
[{valueOf() { return 7; }}, 7],
|
||||
];
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ const badResults = [
|
|||
[-Infinity, RangeError],
|
||||
[Symbol("foo"), TypeError],
|
||||
[7n, TypeError],
|
||||
[NaN, RangeError],
|
||||
["string", RangeError],
|
||||
[{}, RangeError],
|
||||
];
|
||||
|
||||
badResults.forEach(([result, error]) => {
|
||||
|
@ -32,11 +35,8 @@ const convertedResults = [
|
|||
[7.1, 7],
|
||||
[-7, -7],
|
||||
[-0.1, 0],
|
||||
[NaN, 0],
|
||||
["string", 0],
|
||||
["7", 7],
|
||||
["7.5", 7],
|
||||
[{}, 0],
|
||||
[{valueOf() { return 7; }}, 7],
|
||||
];
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ const badResults = [
|
|||
[-Infinity, RangeError],
|
||||
[Symbol("foo"), TypeError],
|
||||
[7n, TypeError],
|
||||
[NaN, RangeError],
|
||||
["string", RangeError],
|
||||
[{}, RangeError],
|
||||
];
|
||||
|
||||
badResults.forEach(([result, error]) => {
|
||||
|
@ -32,11 +35,8 @@ const convertedResults = [
|
|||
[7.1, 7],
|
||||
[-7, -7],
|
||||
[-0.1, 0],
|
||||
[NaN, 0],
|
||||
["string", 0],
|
||||
["7", 7],
|
||||
["7.5", 7],
|
||||
[{}, 0],
|
||||
[{valueOf() { return 7; }}, 7],
|
||||
];
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ const badResults = [
|
|||
[-Infinity, RangeError],
|
||||
[Symbol("foo"), TypeError],
|
||||
[7n, TypeError],
|
||||
[NaN, RangeError],
|
||||
["string", RangeError],
|
||||
[{}, RangeError],
|
||||
];
|
||||
|
||||
badResults.forEach(([result, error]) => {
|
||||
|
@ -32,11 +35,8 @@ const convertedResults = [
|
|||
[7.1, 7],
|
||||
[-7, -7],
|
||||
[-0.1, 0],
|
||||
[NaN, 0],
|
||||
["string", 0],
|
||||
["7", 7],
|
||||
["7.5", 7],
|
||||
[{}, 0],
|
||||
[{valueOf() { return 7; }}, 7],
|
||||
];
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ const badResults = [
|
|||
[-Infinity, RangeError],
|
||||
[Symbol("foo"), TypeError],
|
||||
[7n, TypeError],
|
||||
[NaN, RangeError],
|
||||
["string", RangeError],
|
||||
[{}, RangeError],
|
||||
];
|
||||
|
||||
badResults.forEach(([result, error]) => {
|
||||
|
@ -32,11 +35,8 @@ const convertedResults = [
|
|||
[7.1, 7],
|
||||
[-7, -7],
|
||||
[-0.1, 0],
|
||||
[NaN, 0],
|
||||
["string", 0],
|
||||
["7", 7],
|
||||
["7.5", 7],
|
||||
[{}, 0],
|
||||
[{valueOf() { return 7; }}, 7],
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue