Replace runTestCase with assert helpers [test/built-ins/Math]

This commit is contained in:
André Bargull 2015-08-06 18:26:07 +02:00
parent 8ea6a7e374
commit 33a7e03a76
21 changed files with 22 additions and 148 deletions

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.11 es6id: 20.2.2.11
author: Ryan Lewis author: Ryan Lewis
description: Math.clz32 should return 32 if passed 0. description: Math.clz32 should return 32 if passed 0.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.clz32(0), 32, 'Math.clz32(0)');
if(Math.clz32(0) === 32) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.11 es6id: 20.2.2.11
author: Ryan Lewis author: Ryan Lewis
description: Math.clz32 should return 31 if passed 1. description: Math.clz32 should return 31 if passed 1.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.clz32(1), 31, 'Math.clz32(1)');
if(Math.clz32(1) === 31) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.11 es6id: 20.2.2.11
author: Ryan Lewis author: Ryan Lewis
description: Math.clz32 should return 0 if passed 2147483648 description: Math.clz32 should return 0 if passed 2147483648
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.clz32(2147483648), 0, 'Math.clz32(2147483648)');
if(Math.clz32(2147483648) === 0) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.17 es6id: 20.2.2.17
author: Ryan Lewis author: Ryan Lewis
description: Math.fround should return Infinity if called with Infinity. description: Math.fround should return Infinity if called with Infinity.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.fround(Infinity), Infinity, 'Math.fround(Infinity)');
if(Math.fround(Infinity) === Infinity) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.17 es6id: 20.2.2.17
author: Ryan Lewis author: Ryan Lewis
description: Math.fround should return NaN if called with NaN. description: Math.fround should return NaN if called with NaN.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert(Number.isNaN(Math.fround(NaN)), 'Number.isNaN(Math.fround(NaN)) !== true');
if(Number.isNaN(Math.fround(NaN))) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.17 es6id: 20.2.2.17
author: Ryan Lewis author: Ryan Lewis
description: Math.fround should return 0 if called with 0. description: Math.fround should return 0 if called with 0.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.fround(0), 0, 'Math.fround(0)');
if(Math.fround(0) === 0) {
return true;
}
}
runTestCase(testcase);

View File

@ -7,12 +7,6 @@ author: Ryan Lewis
description: > description: >
Math.hypot should return Infinity if called with any argument that Math.hypot should return Infinity if called with any argument that
is Infinity. is Infinity.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot(3, Infinity), Infinity, 'Math.hypot(3, Infinity)');
if(Math.hypot(3, Infinity) === Infinity) {
return true;
}
}
runTestCase(testcase);

View File

@ -7,12 +7,6 @@ author: Ryan Lewis
description: > description: >
Math.hypot should return Infinity if called with any argument that Math.hypot should return Infinity if called with any argument that
is Infinity. is Infinity.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot(NaN, Infinity), Infinity, 'Math.hypot(NaN, Infinity)');
if(Math.hypot(NaN, Infinity) === Infinity) {
return true;
}
}
runTestCase(testcase);

View File

@ -7,12 +7,6 @@ author: Ryan Lewis
description: > description: >
Math.hypot should return NaN if called with any argument that is Math.hypot should return NaN if called with any argument that is
NaN. NaN.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert(Number.isNaN(Math.hypot(NaN, 3)), 'Number.isNaN(Math.hypot(NaN, 3)) !== true');
if(Number.isNaN(Math.hypot(NaN, 3))) {
return true;
}
}
runTestCase(testcase);

View File

@ -7,12 +7,6 @@ author: Ryan Lewis
description: > description: >
Math.hypot should return Infinity if called with any argument that Math.hypot should return Infinity if called with any argument that
is -Infinity. is -Infinity.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot(3, -Infinity), Infinity, 'Math.hypot(3, -Infinity)');
if(Math.hypot(3, -Infinity) === Infinity) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.18 es6id: 20.2.2.18
author: Ryan Lewis author: Ryan Lewis
description: Math.hypot should return 0 if called with no arguments. description: Math.hypot should return 0 if called with no arguments.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot(), 0, 'Math.hypot()');
if(Math.hypot() === 0) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.18 es6id: 20.2.2.18
author: Ryan Lewis author: Ryan Lewis
description: Math.hypot should return 4 if called with 3 and 2.6457513110645907. description: Math.hypot should return 4 if called with 3 and 2.6457513110645907.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot(3,2.6457513110645907), 4, 'Math.hypot(3,2.6457513110645907)');
if(Math.hypot(3,2.6457513110645907) === 4) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.18 es6id: 20.2.2.18
author: Ryan Lewis author: Ryan Lewis
description: Math.hypot should return 5 if called with 3 and 4. description: Math.hypot should return 5 if called with 3 and 4.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot(3,4), 5, 'Math.hypot(3,4)');
if(Math.hypot(3,4) === 5) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.18 es6id: 20.2.2.18
author: Ryan Lewis author: Ryan Lewis
description: Math.hypot should return 0 if called with all arguments being 0. description: Math.hypot should return 0 if called with all arguments being 0.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot(0, 0), 0, 'Math.hypot(0, 0)');
if(Math.hypot(0, 0) === 0) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.18 es6id: 20.2.2.18
author: Ryan Lewis author: Ryan Lewis
description: Math.hypot.length should return 2. description: Math.hypot.length should return 2.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.hypot.length, 2, 'Math.hypot.length');
if(Math.hypot.length === 2) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.35 es6id: 20.2.2.35
author: Ryan Lewis author: Ryan Lewis
description: Math.trunc should return Infinity when called with Infinity. description: Math.trunc should return Infinity when called with Infinity.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.trunc(.9), 0, 'Math.trunc(.9)');
if(Math.trunc(.9) === 0) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.35 es6id: 20.2.2.35
author: Ryan Lewis author: Ryan Lewis
description: Math.trunc should return NaN when called with NaN. description: Math.trunc should return NaN when called with NaN.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert(Number.isNaN(Math.trunc(NaN)), 'Number.isNaN(Math.trunc(NaN)) !== true');
if(Number.isNaN(Math.trunc(NaN))) {
return true;
}
}
runTestCase(testcase);

View File

@ -4,13 +4,7 @@
/*--- /*---
es6id: 20.2.2.35 es6id: 20.2.2.35
author: Ryan Lewis author: Ryan Lewis
description: Math.trunc should return 0 if called with a value between 0 and -1. description: Math.trunc should return -0 if called with a value between 0 and -1.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.trunc(-.9), -0, 'Math.trunc(-.9)');
if(Math.trunc(-.9) === 0) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.35 es6id: 20.2.2.35
author: Ryan Lewis author: Ryan Lewis
description: Math.trunc should return 0 if called with a value between 0 and 1. description: Math.trunc should return 0 if called with a value between 0 and 1.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.trunc(.9), 0, 'Math.trunc(.9)');
if(Math.trunc(.9) === 0) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.35 es6id: 20.2.2.35
author: Ryan Lewis author: Ryan Lewis
description: Math.trunc should return 4578 if called with 4578.584949 description: Math.trunc should return 4578 if called with 4578.584949
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.trunc(4578.584949), 4578, 'Math.trunc(4578.584949)');
if(Math.trunc(4578.584949) === 4578) {
return true;
}
}
runTestCase(testcase);

View File

@ -5,12 +5,6 @@
es6id: 20.2.2.35 es6id: 20.2.2.35
author: Ryan Lewis author: Ryan Lewis
description: Math.trunc should return 0 when called with 0. description: Math.trunc should return 0 when called with 0.
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.sameValue(Math.trunc(0), 0, 'Math.trunc(0)');
if(Math.trunc(0) === 0) {
return true;
}
}
runTestCase(testcase);