mirror of https://github.com/tc39/test262.git
Replace runTestCase with assert helpers [test/built-ins/Math]
This commit is contained in:
parent
8ea6a7e374
commit
33a7e03a76
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.11
|
||||
author: Ryan Lewis
|
||||
description: Math.clz32 should return 32 if passed 0.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.clz32(0) === 32) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.clz32(0), 32, 'Math.clz32(0)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.11
|
||||
author: Ryan Lewis
|
||||
description: Math.clz32 should return 31 if passed 1.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.clz32(1) === 31) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.clz32(1), 31, 'Math.clz32(1)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.11
|
||||
author: Ryan Lewis
|
||||
description: Math.clz32 should return 0 if passed 2147483648
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.clz32(2147483648) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.clz32(2147483648), 0, 'Math.clz32(2147483648)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.17
|
||||
author: Ryan Lewis
|
||||
description: Math.fround should return Infinity if called with Infinity.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.fround(Infinity) === Infinity) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.fround(Infinity), Infinity, 'Math.fround(Infinity)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.17
|
||||
author: Ryan Lewis
|
||||
description: Math.fround should return NaN if called with NaN.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isNaN(Math.fround(NaN))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Number.isNaN(Math.fround(NaN)), 'Number.isNaN(Math.fround(NaN)) !== true');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.17
|
||||
author: Ryan Lewis
|
||||
description: Math.fround should return 0 if called with 0.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.fround(0) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.fround(0), 0, 'Math.fround(0)');
|
||||
|
|
|
@ -7,12 +7,6 @@ author: Ryan Lewis
|
|||
description: >
|
||||
Math.hypot should return Infinity if called with any argument that
|
||||
is Infinity.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot(3, Infinity) === Infinity) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot(3, Infinity), Infinity, 'Math.hypot(3, Infinity)');
|
||||
|
|
|
@ -7,12 +7,6 @@ author: Ryan Lewis
|
|||
description: >
|
||||
Math.hypot should return Infinity if called with any argument that
|
||||
is Infinity.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot(NaN, Infinity) === Infinity) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot(NaN, Infinity), Infinity, 'Math.hypot(NaN, Infinity)');
|
||||
|
|
|
@ -7,12 +7,6 @@ author: Ryan Lewis
|
|||
description: >
|
||||
Math.hypot should return NaN if called with any argument that is
|
||||
NaN.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isNaN(Math.hypot(NaN, 3))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Number.isNaN(Math.hypot(NaN, 3)), 'Number.isNaN(Math.hypot(NaN, 3)) !== true');
|
||||
|
|
|
@ -7,12 +7,6 @@ author: Ryan Lewis
|
|||
description: >
|
||||
Math.hypot should return Infinity if called with any argument that
|
||||
is -Infinity.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot(3, -Infinity) === Infinity) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot(3, -Infinity), Infinity, 'Math.hypot(3, -Infinity)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.18
|
||||
author: Ryan Lewis
|
||||
description: Math.hypot should return 0 if called with no arguments.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot() === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot(), 0, 'Math.hypot()');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.18
|
||||
author: Ryan Lewis
|
||||
description: Math.hypot should return 4 if called with 3 and 2.6457513110645907.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot(3,2.6457513110645907) === 4) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot(3,2.6457513110645907), 4, 'Math.hypot(3,2.6457513110645907)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.18
|
||||
author: Ryan Lewis
|
||||
description: Math.hypot should return 5 if called with 3 and 4.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot(3,4) === 5) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot(3,4), 5, 'Math.hypot(3,4)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.18
|
||||
author: Ryan Lewis
|
||||
description: Math.hypot should return 0 if called with all arguments being 0.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot(0, 0) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot(0, 0), 0, 'Math.hypot(0, 0)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.18
|
||||
author: Ryan Lewis
|
||||
description: Math.hypot.length should return 2.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.hypot.length === 2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.hypot.length, 2, 'Math.hypot.length');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.35
|
||||
author: Ryan Lewis
|
||||
description: Math.trunc should return Infinity when called with Infinity.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.trunc(.9) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.trunc(.9), 0, 'Math.trunc(.9)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.35
|
||||
author: Ryan Lewis
|
||||
description: Math.trunc should return NaN when called with NaN.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Number.isNaN(Math.trunc(NaN))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert(Number.isNaN(Math.trunc(NaN)), 'Number.isNaN(Math.trunc(NaN)) !== true');
|
||||
|
|
|
@ -4,13 +4,7 @@
|
|||
/*---
|
||||
es6id: 20.2.2.35
|
||||
author: Ryan Lewis
|
||||
description: Math.trunc should return 0 if called with a value between 0 and -1.
|
||||
includes: [runTestCase.js]
|
||||
description: Math.trunc should return -0 if called with a value between 0 and -1.
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.trunc(-.9) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.trunc(-.9), -0, 'Math.trunc(-.9)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.35
|
||||
author: Ryan Lewis
|
||||
description: Math.trunc should return 0 if called with a value between 0 and 1.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.trunc(.9) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.trunc(.9), 0, 'Math.trunc(.9)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.35
|
||||
author: Ryan Lewis
|
||||
description: Math.trunc should return 4578 if called with 4578.584949
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.trunc(4578.584949) === 4578) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.trunc(4578.584949), 4578, 'Math.trunc(4578.584949)');
|
||||
|
|
|
@ -5,12 +5,6 @@
|
|||
es6id: 20.2.2.35
|
||||
author: Ryan Lewis
|
||||
description: Math.trunc should return 0 when called with 0.
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
if(Math.trunc(0) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
assert.sameValue(Math.trunc(0), 0, 'Math.trunc(0)');
|
||||
|
|
Loading…
Reference in New Issue