mirror of https://github.com/tc39/test262.git
Replace runTestCase with assert helpers [test/built-ins/Number]
This commit is contained in:
parent
33a7e03a76
commit
6cd7b9e275
|
@ -4,12 +4,6 @@
|
|||
/*---
|
||||
es5id: 15.7.3-1
|
||||
description: Number constructor - [[Prototype]] is the Function prototype object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if (Function.prototype.isPrototypeOf(Number) === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Function.prototype.isPrototypeOf(Number), true, 'Function.prototype.isPrototypeOf(Number)');
|
||||
|
|
|
@ -6,13 +6,8 @@ es5id: 15.7.3-2
|
|||
description: >
|
||||
Number constructor - [[Prototype]] is the Function prototype
|
||||
object (using getPrototypeOf)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var p = Object.getPrototypeOf(Number);
|
||||
if (p === Function.prototype) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(p, Function.prototype, 'p');
|
||||
|
|
|
@ -4,12 +4,9 @@
|
|||
/*---
|
||||
es5id: 15.7.4-1
|
||||
description: "Number prototype object: its [[Class]] must be 'Object'"
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var numProto = Object.getPrototypeOf(new Number(42));
|
||||
var s = Object.prototype.toString.call(numProto );
|
||||
return (s === '[object Object]') ;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(s, '[object Object]', 's');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.1.2.3
|
||||
author: Ryan Lewis
|
||||
description: Number.isInteger should return false if called with a double.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isInteger(6.75) === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Number.isInteger(6.75), false, 'Number.isInteger(6.75)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.1.2.3
|
||||
author: Ryan Lewis
|
||||
description: Number.isInteger should return false if called with Infinity.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isInteger(Infinity) === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Number.isInteger(Infinity), false, 'Number.isInteger(Infinity)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.1.2.3
|
||||
author: Ryan Lewis
|
||||
description: Number.isInteger should return false if called with NaN.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isInteger(NaN) === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Number.isInteger(NaN), false, 'Number.isInteger(NaN)');
|
||||
|
|
|
@ -7,12 +7,6 @@ author: Ryan Lewis
|
|||
description: >
|
||||
Number.isInteger should return false if called with a string
|
||||
(non-Number)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isInteger('2') === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Number.isInteger('2'), false, 'Number.isInteger("2")');
|
||||
|
|
|
@ -7,12 +7,6 @@ author: Ryan Lewis
|
|||
description: >
|
||||
Number.isInteger should return false if called with a string
|
||||
(non-Number)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isInteger('word') === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Number.isInteger('word'), false, 'Number.isInteger("word")');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.1.2.3
|
||||
author: Ryan Lewis
|
||||
description: Number.isInteger should return true if called with an integer.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isInteger(478) === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Number.isInteger(478), true, 'Number.isInteger(478)');
|
||||
|
|
|
@ -6,16 +6,11 @@ es5id: 15.7.3.1-1
|
|||
description: >
|
||||
Number.prototype is a data property with default attribute values
|
||||
(false)
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = Object.getOwnPropertyDescriptor(Number, 'prototype');
|
||||
|
||||
if (d.writable === false &&
|
||||
d.enumerable === false &&
|
||||
d.configurable === false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d.writable, false, 'd.writable');
|
||||
assert.sameValue(d.enumerable, false, 'd.enumerable');
|
||||
assert.sameValue(d.configurable, false, 'd.configurable');
|
||||
|
|
|
@ -4,11 +4,8 @@
|
|||
/*---
|
||||
es5id: 15.7.3.1-2
|
||||
description: Number.prototype, initial value is the Number prototype object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
// assume that Number.prototype has not been modified.
|
||||
return Object.getPrototypeOf(new Number(42))===Number.prototype;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(Object.getPrototypeOf(new Number(42)), Number.prototype, 'Object.getPrototypeOf(new Number(42))');
|
||||
|
|
Loading…
Reference in New Issue