mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Transform legacy format to harness assertions: test/built-ins/I*/**/*.js
This commit is contained in:
parent
1286bb601e
commit
ec9c9b8dfd
@ -6,24 +6,12 @@ info: The initial value of Infinity is Number.POSITIVE_INFINITY
|
|||||||
es5id: 15.1.1.2_A1
|
es5id: 15.1.1.2_A1
|
||||||
description: Use typeof, isNaN, isFinite
|
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
|
assert.sameValue(
|
||||||
if (typeof(Infinity) !== "number") {
|
Infinity,
|
||||||
throw new Test262Error('#1: typeof(Infinity) === "number". Actual: ' + (typeof(Infinity)));
|
Number.POSITIVE_INFINITY,
|
||||||
}
|
'The value of Infinity is expected to equal the value of Number.POSITIVE_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));
|
|
||||||
}
|
|
||||||
|
@ -10,6 +10,6 @@ flags: [noStrict]
|
|||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
Infinity = true;
|
Infinity = true;
|
||||||
if (typeof(Infinity) === "boolean") {
|
assert.notSameValue(typeof(Infinity), "boolean", 'The value of typeof(Infinity) is not "boolean"');
|
||||||
throw new Test262Error('#1: Infinity = true; typeof(Infinity) !== "boolean". Actual: ' + (typeof(Infinity)));
|
|
||||||
}
|
// TODO: Convert to verifyProperty() format.
|
||||||
|
@ -7,8 +7,6 @@ es5id: 15.1.1.2_A3_T2
|
|||||||
description: Use delete
|
description: Use delete
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
assert.sameValue(delete Infinity, false, 'The value of `delete Infinity` is expected to be false');
|
||||||
|
|
||||||
// CHECK#1
|
// TODO: Convert to verifyProperty() format.
|
||||||
if (delete Infinity !== false) {
|
|
||||||
throw new Test262Error('#1: delete Infinity === false. Actual: ' + (delete Infinity));
|
|
||||||
}
|
|
||||||
|
@ -9,7 +9,7 @@ description: Use for-in statement
|
|||||||
|
|
||||||
// CHECK#1
|
// CHECK#1
|
||||||
for (var prop in this) {
|
for (var prop in this) {
|
||||||
if (prop === "Infinity") {
|
assert.notSameValue(prop, "Infinity", 'The value of prop is not "Infinity"');
|
||||||
throw new Test262Error('#1: The Infinity is DontEnum');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Convert to verifyProperty() format.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user