Transform legacy format to harness assertions: test/built-ins/I*/**/*.js

This commit is contained in:
rwaldron 2021-08-11 15:00:29 -04:00 committed by Leo Balter
parent 1286bb601e
commit ec9c9b8dfd
4 changed files with 16 additions and 30 deletions

View File

@ -6,24 +6,12 @@ info: The initial value of Infinity is Number.POSITIVE_INFINITY
es5id: 15.1.1.2_A1
description: Use typeof, isNaN, isFinite
---*/
assert.sameValue(typeof(Infinity), "number", 'The value of `typeof(Infinity)` is expected to be "number"');
assert.sameValue(isFinite(Infinity), false, 'isFinite(Infinity) must return false');
assert.sameValue(isNaN(Infinity), false, 'isNaN(Infinity) must return false');
// CHECK#1
if (typeof(Infinity) !== "number") {
throw new Test262Error('#1: typeof(Infinity) === "number". Actual: ' + (typeof(Infinity)));
}
// CHECK#2
if (isFinite(Infinity) !== false) {
throw new Test262Error('#2: Infinity === Not-a-Finite. Actual: ' + (Infinity));
}
// CHECK#3
if (isNaN(Infinity) !== false) {
throw new Test262Error('#3: Infinity === Not-a-Number. Actual: ' + (Infinity));
}
// CHECK#4
if (Infinity !== Number.POSITIVE_INFINITY) {
throw new Test262Error('#4: Infinity === Number.POSITIVE_INFINITY. Actual: ' + (Infinity));
}
assert.sameValue(
Infinity,
Number.POSITIVE_INFINITY,
'The value of Infinity is expected to equal the value of Number.POSITIVE_INFINITY'
);

View File

@ -10,6 +10,6 @@ flags: [noStrict]
// CHECK#1
Infinity = true;
if (typeof(Infinity) === "boolean") {
throw new Test262Error('#1: Infinity = true; typeof(Infinity) !== "boolean". Actual: ' + (typeof(Infinity)));
}
assert.notSameValue(typeof(Infinity), "boolean", 'The value of typeof(Infinity) is not "boolean"');
// TODO: Convert to verifyProperty() format.

View File

@ -7,8 +7,6 @@ es5id: 15.1.1.2_A3_T2
description: Use delete
flags: [noStrict]
---*/
assert.sameValue(delete Infinity, false, 'The value of `delete Infinity` is expected to be false');
// CHECK#1
if (delete Infinity !== false) {
throw new Test262Error('#1: delete Infinity === false. Actual: ' + (delete Infinity));
}
// TODO: Convert to verifyProperty() format.

View File

@ -9,7 +9,7 @@ description: Use for-in statement
// CHECK#1
for (var prop in this) {
if (prop === "Infinity") {
throw new Test262Error('#1: The Infinity is DontEnum');
}
assert.notSameValue(prop, "Infinity", 'The value of prop is not "Infinity"');
}
// TODO: Convert to verifyProperty() format.