diff options
Diffstat (limited to 'test/built-ins/Array')
100 files changed, 140 insertions, 684 deletions
diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-1.js b/test/built-ins/Array/isArray/15.4.3.2-1-1.js index d89e4cd2a..2374fd7ef 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-1.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-1.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-1 description: Array.isArray applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(true); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(true), false, 'Array.isArray(true)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-10.js b/test/built-ins/Array/isArray/15.4.3.2-1-10.js index ee02196fc..395c3b4dc 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-10.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-10.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-10 description: Array.isArray applied to RegExp object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new RegExp()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new RegExp()), false, 'Array.isArray(new RegExp())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-11.js b/test/built-ins/Array/isArray/15.4.3.2-1-11.js index fdb958b43..6a83171f9 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-11.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-11.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-11 description: Array.isArray applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(JSON); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(JSON), false, 'Array.isArray(JSON)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-12.js b/test/built-ins/Array/isArray/15.4.3.2-1-12.js index 333e2bb81..2b1aaa798 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-12.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-12.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-12 description: Array.isArray applied to Error object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new SyntaxError()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new SyntaxError()), false, 'Array.isArray(new SyntaxError())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-15.js b/test/built-ins/Array/isArray/15.4.3.2-1-15.js index 12645ff98..048859180 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-15.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-15.js @@ -4,13 +4,7 @@ /*--- es5id: 15.4.3.2-1-15 description: Array.isArray applied to the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - return !Array.isArray(fnGlobalObject()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(fnGlobalObject()), false, 'Array.isArray(fnGlobalObject())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-2.js b/test/built-ins/Array/isArray/15.4.3.2-1-2.js index b79d46bae..94624b520 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-2.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-2.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-2 description: Array.isArray applied to Boolean Object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new Boolean(false)); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new Boolean(false)), false, 'Array.isArray(new Boolean(false))'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-3.js b/test/built-ins/Array/isArray/15.4.3.2-1-3.js index e7e0caf5b..d6a2bf581 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-3.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-3 description: Array.isArray applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(5); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(5), false, 'Array.isArray(5)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-4.js b/test/built-ins/Array/isArray/15.4.3.2-1-4.js index 5f3d6a378..dec4307f3 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-4.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-4 description: Array.isArray applied to Number object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new Number(-3)); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new Number(-3)), false, 'Array.isArray(new Number(-3))'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-5.js b/test/built-ins/Array/isArray/15.4.3.2-1-5.js index a8abc5d0d..39777f333 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-5.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-5 description: Array.isArray applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray("abc"); - } -runTestCase(testcase); +assert.sameValue(Array.isArray("abc"), false, 'Array.isArray("abc")'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-6.js b/test/built-ins/Array/isArray/15.4.3.2-1-6.js index b6c0e1a40..82b6b6aa1 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-6.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-6.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-6 description: Array.isArray applied to String object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new String("hello\nworld\\!")); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new String("hello\nworld\\!")), false, 'Array.isArray(new String("hello\nworld\\!"))'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-7.js b/test/built-ins/Array/isArray/15.4.3.2-1-7.js index 44af09a80..6bf491fff 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-7.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-7.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-7 description: Array.isArray applied to Function object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(function () { }); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(function () { }), false, 'Array.isArray(function () { })'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-8.js b/test/built-ins/Array/isArray/15.4.3.2-1-8.js index 2602420aa..ecb60080e 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-8.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-8.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-8 description: Array.isArray applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(Math); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(Math), false, 'Array.isArray(Math)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-9.js b/test/built-ins/Array/isArray/15.4.3.2-1-9.js index 688d178f0..31ac3fbf4 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-9.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-9.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-9 description: Array.isArray applied to Date object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new Date()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new Date()), false, 'Array.isArray(new Date())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-3.js b/test/built-ins/Array/isArray/15.4.3.2-2-3.js index 5f16b65f0..34459c2dc 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-3.js @@ -6,11 +6,6 @@ es5id: 15.4.3.2-2-3 description: > Array.isArray applied to an Array-like object with length and some indexed properties -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray({ 0: 12, 1: 9, length: 2 }); - } -runTestCase(testcase); +assert.sameValue(Array.isArray({ 0: 12, 1: 9, length: 2 }), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js index 0916a43dd..d48adccb4 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-1-7 description: Array.prototype.indexOf applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return Array.prototype.indexOf.call("abc", "b") === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call("abc", "b"), 1, 'Array.prototype.indexOf.call("abc", "b")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js index cd36077d2..08f805073 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-13 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, -Infinity) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, -Infinity), 0, '[true].indexOf(true, -Infinity)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js index 674e03dc7..ad4a1a61f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js @@ -6,11 +6,7 @@ es5id: 15.4.4.14-5-14 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, NaN) === 0 && [true].indexOf(true, -NaN) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, NaN), 0, '[true].indexOf(true, NaN)'); +assert.sameValue([true].indexOf(true, -NaN), 0, '[true].indexOf(true, -NaN)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js index de7b827c1..6ea2d1a7c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js @@ -6,12 +6,7 @@ es5id: 15.4.4.14-5-15 description: > Array.prototype.indexOf - value of 'fromIndex' is a string containing a negative number -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true, 2].indexOf(true, "-1") === -1 && - [0, 1, true].indexOf(true, "-1") === 2; - } -runTestCase(testcase); +assert.sameValue([0, true, 2].indexOf(true, "-1"), -1, '[0, true, 2].indexOf(true, "-1")'); +assert.sameValue([0, 1, true].indexOf(true, "-1"), 2, '[0, 1, true].indexOf(true, "-1")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js index e69de33f2..324d58d54 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-17 description: > Array.prototype.indexOf - value of 'fromIndex' is a string containing -Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, "-Infinity") === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, "-Infinity"), 0, '[true].indexOf(true, "-Infinity")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js index 6c46d4995..791bc1b6b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js @@ -6,15 +6,10 @@ es5id: 15.4.4.14-5-33 description: > Array.prototype.indexOf match on the first element, a middle element and the last element when 'fromIndex' is passed -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, 1, 2, 3, 4].indexOf(0, 0) === 0 && - [0, 1, 2, 3, 4].indexOf(2, 1) === 2 && - [0, 1, 2, 3, 4].indexOf(2, 2) === 2 && - [0, 1, 2, 3, 4].indexOf(4, 2) === 4 && - [0, 1, 2, 3, 4].indexOf(4, 4) === 4; - } -runTestCase(testcase); +assert.sameValue([0, 1, 2, 3, 4].indexOf(0, 0), 0, '[0, 1, 2, 3, 4].indexOf(0, 0)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(2, 1), 2, '[0, 1, 2, 3, 4].indexOf(2, 1)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(2, 2), 2, '[0, 1, 2, 3, 4].indexOf(2, 2)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(4, 2), 4, '[0, 1, 2, 3, 4].indexOf(4, 2)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(4, 4), 4, '[0, 1, 2, 3, 4].indexOf(4, 4)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js index 77021d2c0..0be678f97 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-7 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, 0) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, 0), 0, '[true].indexOf(true, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js index 439deeabd..a703e616f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-8 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, +0) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, +0), 0, '[true].indexOf(true, +0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js index 2b2fa9b07..44d8c0887 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-9 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, -0) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, -0), 0, '[true].indexOf(true, -0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js index 44cb45a3e..77db06880 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-7-1 description: > Array.prototype.indexOf returns -1 when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(1, 2) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(1, 2), -1, '[1, 2, 3].indexOf(1, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js index 2a8585830..e2d4af59f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-7-2 description: > Array.prototype.indexOf returns correct index when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(3, 2) === 2; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(3, 2), 2, '[1, 2, 3].indexOf(3, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js index 44f682486..f6ffe860f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-7-3 description: > Array.prototype.indexOf returns -1 when 'fromIndex' and 'length' are both 0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [].indexOf(1, 0) === -1; - } -runTestCase(testcase); +assert.sameValue([].indexOf(1, 0), -1, '[].indexOf(1, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js index 09db35e37..9b9986a41 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-7-4 description: Array.prototype.indexOf returns -1 when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(1, 1) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(1, 1), -1, '[1, 2, 3].indexOf(1, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js index ab2db3e5f..dff5a445d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-7-5 description: Array.prototype.indexOf returns correct index when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(2, 1) === 1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(2, 1), 1, '[1, 2, 3].indexOf(2, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js index c65c70213..02441ef35 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-8-2 description: > Array.prototype.indexOf returns correct index when 'fromIndex' is -1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].indexOf(4, -1) === 3; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].indexOf(4, -1), 3, '[1, 2, 3, 4].indexOf(4, -1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js index e195d0e06..8c004c801 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-8-3 description: > Array.prototype.indexOf returns -1 when abs('fromIndex') is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].indexOf(1, -3) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].indexOf(1, -3), -1, '[1, 2, 3, 4].indexOf(1, -3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js index 8db32ee4b..33b2459bd 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-8-4 description: > Array.prototype.indexOf returns -1 when abs('fromIndex') is length of array -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].indexOf(0, -4) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].indexOf(0, -4), -1, '[1, 2, 3, 4].indexOf(0, -4)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js index 63093afc9..cd0be7aa5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-9-b-1 description: Array.prototype.indexOf - non-existent property wouldn't be called -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, , 2].indexOf(undefined) === -1; - } -runTestCase(testcase); +assert.sameValue([0, , 2].indexOf(undefined), -1, '[0, , 2].indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js index 6a22313a4..c37adf4db 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js @@ -6,12 +6,8 @@ es5id: 15.4.4.14-9-b-i-2 description: > Array.prototype.indexOf - element to be retrieved is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - return [true, true, true].indexOf(true) === 0 && - [false, true, true].indexOf(true) === 1 && - [false, false, true].indexOf(true) === 2; - } -runTestCase(testcase); +assert.sameValue([true, true, true].indexOf(true), 0, '[true, true, true].indexOf(true)'); +assert.sameValue([false, true, true].indexOf(true), 1, '[false, true, true].indexOf(true)'); +assert.sameValue([false, false, true].indexOf(true), 2, '[false, false, true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js index 0f9dceb18..9551e31c7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js @@ -6,16 +6,11 @@ es5id: 15.4.4.14-9-b-ii-1 description: > Array.prototype.indexOf - type of array element is different from type of search element -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["true"].indexOf(true) === -1 && - ["0"].indexOf(0) === -1 && - [false].indexOf(0) === -1 && - [undefined].indexOf(0) === -1 && - [null].indexOf(0) === -1 && - [[]].indexOf(0) === -1; - } -runTestCase(testcase); +assert.sameValue(["true"].indexOf(true), -1, '["true"].indexOf(true)'); +assert.sameValue(["0"].indexOf(0), -1, '["0"].indexOf(0)'); +assert.sameValue([false].indexOf(0), -1, '[false].indexOf(0)'); +assert.sameValue([undefined].indexOf(0), -1, '[undefined].indexOf(0)'); +assert.sameValue([null].indexOf(0), -1, '[null].indexOf(0)'); +assert.sameValue([[]].indexOf(0), -1, '[[]].indexOf(0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js index d994687cf..c5e6b04d1 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-10 description: > Array.prototype.indexOf - both array element and search element are Boolean type, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [false, true].indexOf(true) === 1; - } -runTestCase(testcase); +assert.sameValue([false, true].indexOf(true), 1, '[false, true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js index 47bd171aa..a47ce0139 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js @@ -6,14 +6,10 @@ es5id: 15.4.4.14-9-b-ii-11 description: > Array.prototype.indexOf - both array element and search element are Object type, and they refer to the same object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj1 = {}; var obj2 = {}; var obj3 = obj2; - return [{}, obj1, obj2].indexOf(obj3) === 2; - } -runTestCase(testcase); + +assert.sameValue([{}, obj1, obj2].indexOf(obj3), 2, '[{}, obj1, obj2].indexOf(obj3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js index f5eacb27e..77e3af80c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js @@ -6,11 +6,7 @@ es5id: 15.4.4.14-9-b-ii-2 description: > Array.prototype.indexOf - both type of array element and type of search element are Undefined -includes: [runTestCase.js] ---*/ -function testcase() { - - return [undefined].indexOf() === 0 && [undefined].indexOf(undefined) === 0; - } -runTestCase(testcase); +assert.sameValue([undefined].indexOf(), 0, '[undefined].indexOf()'); +assert.sameValue([undefined].indexOf(undefined), 0, '[undefined].indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js index 3674c2b54..6941589c7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-3 description: > Array.prototype.indexOf - both type of array element and type of search element are null -includes: [runTestCase.js] ---*/ -function testcase() { - - return [null].indexOf(null) === 0; - } -runTestCase(testcase); +assert.sameValue([null].indexOf(null), 0, '[null].indexOf(null)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js index a3a6cada6..0cbb8224b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-9-b-ii-4 description: Array.prototype.indexOf - search element is NaN -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+NaN, NaN, -NaN].indexOf(NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].indexOf(NaN), -1, '[+NaN, NaN, -NaN].indexOf(NaN)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js index 337c8fae3..e31dfff98 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-9-b-ii-5 description: Array.prototype.indexOf - search element is -NaN -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+NaN, NaN, -NaN].indexOf(-NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].indexOf(-NaN), -1, '[+NaN, NaN, -NaN].indexOf(-NaN)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js index c93162e4d..75eda5e67 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-6 description: > Array.prototype.indexOf - array element is +0 and search element is -0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+0].indexOf(-0) === 0; - } -runTestCase(testcase); +assert.sameValue([+0].indexOf(-0), 0, '[+0].indexOf(-0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js index 6184e05e1..c3acc3530 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-7 description: > Array.prototype.indexOf - array element is -0 and search element is +0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-0].indexOf(+0) === 0; - } -runTestCase(testcase); +assert.sameValue([-0].indexOf(+0), 0, '[-0].indexOf(+0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js index 50ea1b629..2cedb40c2 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-8 description: > Array.prototype.indexOf - both array element and search element are Number, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-1, 0, 1].indexOf(1) === 2; - } -runTestCase(testcase); +assert.sameValue([-1, 0, 1].indexOf(1), 2, '[-1, 0, 1].indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js index 959250a89..e5499b663 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-9 description: > Array.prototype.indexOf - both array element and search element are String, and they have exactly the same sequence of characters -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["", "ab", "bca", "abc"].indexOf("abc") === 3; - } -runTestCase(testcase); +assert.sameValue(["", "ab", "bca", "abc"].indexOf("abc"), 3, '["", "ab", "bca", "abc"].indexOf("abc")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js index fa1d4e5d0..1e9bc0d3c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-iii-1 description: > Array.prototype.indexOf - returns index of last one when more than two elements in array are eligible -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 2, 1, 2].indexOf(2) === 1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 2, 1, 2].indexOf(2), 1, '[1, 2, 2, 1, 2].indexOf(2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js index caf111c8f..11ed44ee7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-1-7 description: Array.prototype.lastIndexOf applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return Array.prototype.lastIndexOf.call("abc", "c") === 2; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call("abc", "c"), 2, 'Array.prototype.lastIndexOf.call("abc", "c")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js index 7b789da46..f92d51835 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-5-13 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].lastIndexOf(true, -Infinity) === -1; - } -runTestCase(testcase); +assert.sameValue([true].lastIndexOf(true, -Infinity), -1, '[true].lastIndexOf(true, -Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js index 32b9e429c..7e08f9923 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js @@ -6,14 +6,10 @@ es5id: 15.4.4.15-5-14 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true].lastIndexOf(true, NaN) === -1 && // from Index will be convert to +0 - [true, 0].lastIndexOf(true, NaN) === 0 && - [0, true].lastIndexOf(true, -NaN) === -1 && - [true, 0].lastIndexOf(true, -NaN) === 0; - } -runTestCase(testcase); +// from Index will be convert to +0 +assert.sameValue([0, true].lastIndexOf(true, NaN), -1, '[0, true].lastIndexOf(true, NaN)'); +assert.sameValue([true, 0].lastIndexOf(true, NaN), 0, '[true, 0].lastIndexOf(true, NaN)'); +assert.sameValue([0, true].lastIndexOf(true, -NaN), -1, '[0, true].lastIndexOf(true, -NaN)'); +assert.sameValue([true, 0].lastIndexOf(true, -NaN), 0, '[true, 0].lastIndexOf(true, -NaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js index 51ca82ad7..295b11809 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js @@ -6,12 +6,7 @@ es5id: 15.4.4.15-5-15 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing a negative number -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, "-2", 2].lastIndexOf("-2", "-2") === 1 && - [0, 2, "-2"].lastIndexOf("-2", "-2") === -1; - } -runTestCase(testcase); +assert.sameValue([0, "-2", 2].lastIndexOf("-2", "-2"), 1, '[0, "-2", 2].lastIndexOf("-2", "-2")'); +assert.sameValue([0, 2, "-2"].lastIndexOf("-2", "-2"), -1, '[0, 2, "-2"].lastIndexOf("-2", "-2")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js index 5508b81ce..1d994c504 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-5-17 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing -Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].lastIndexOf(true, "-Infinity") === -1; - } -runTestCase(testcase); +assert.sameValue([true].lastIndexOf(true, "-Infinity"), -1, '[true].lastIndexOf(true, "-Infinity")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js index 3486b0ce8..fc8f059e2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js @@ -6,15 +6,10 @@ es5id: 15.4.4.15-5-33 description: > Array.prototype.lastIndexOf - match on the first element, a middle element and the last element when 'fromIndex' is passed -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, 1, 2, 3, 4].lastIndexOf(0, 0) === 0 && - [0, 1, 2, 3, 4].lastIndexOf(0, 2) === 0 && - [0, 1, 2, 3, 4].lastIndexOf(2, 2) === 2 && - [0, 1, 2, 3, 4].lastIndexOf(2, 4) === 2 && - [0, 1, 2, 3, 4].lastIndexOf(4, 4) === 4; - } -runTestCase(testcase); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(0, 0), 0, '[0, 1, 2, 3, 4].lastIndexOf(0, 0)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(0, 2), 0, '[0, 1, 2, 3, 4].lastIndexOf(0, 2)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(2, 2), 2, '[0, 1, 2, 3, 4].lastIndexOf(2, 2)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(2, 4), 2, '[0, 1, 2, 3, 4].lastIndexOf(2, 4)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(4, 4), 4, '[0, 1, 2, 3, 4].lastIndexOf(4, 4)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js index 426ee071f..ddd70c04c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js @@ -6,12 +6,7 @@ es5id: 15.4.4.15-5-8 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true].lastIndexOf(true, +0) === -1 && - [true, 0].lastIndexOf(true, +0) === 0; - } -runTestCase(testcase); +assert.sameValue([0, true].lastIndexOf(true, +0), -1, '[0, true].lastIndexOf(true, +0)'); +assert.sameValue([true, 0].lastIndexOf(true, +0), 0, '[true, 0].lastIndexOf(true, +0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js index e1d6ae2d1..5ecdcb1d8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js @@ -6,12 +6,7 @@ es5id: 15.4.4.15-5-9 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true].lastIndexOf(true, -0) === -1 && - [true, 0].lastIndexOf(true, -0) === 0; - } -runTestCase(testcase); +assert.sameValue([0, true].lastIndexOf(true, -0), -1, '[0, true].lastIndexOf(true, -0)'); +assert.sameValue([true, 0].lastIndexOf(true, -0), 0, '[true, 0].lastIndexOf(true, -0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js index f47cab40a..3015f756c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-2 description: > Array.prototype.lastIndexOf returns correct index when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(3, 2) === 2; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(3, 2), 2, '[1, 2, 3].lastIndexOf(3, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js index 6f64ea3a7..d994fd9ab 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-3 description: > Array.prototype.lastIndexOf returns -1 when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(3, 1) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(3, 1), -1, '[1, 2, 3].lastIndexOf(3, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js index 844767010..580791ef5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-4 description: > Array.prototype.lastIndexOf returns -1 when 'fromIndex' and 'length' are both 0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [].lastIndexOf(1, 0) === -1; - } -runTestCase(testcase); +assert.sameValue([].lastIndexOf(1, 0), -1, '[].lastIndexOf(1, 0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js index ba40a95ce..a1f9d1405 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-6-5 description: Array.prototype.lastIndexOf returns -1 when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(3, 1) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(3, 1), -1, '[1, 2, 3].lastIndexOf(3, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js index 8e1ca80bb..a4a313ab2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-6 description: > Array.prototype.lastIndexOf returns correct index when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(2, 1) === 1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(2, 1), 1, '[1, 2, 3].lastIndexOf(2, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js index 779e9b5c7..35195a5b6 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-7-2 description: > Array.prototype.lastIndexOf returns correct index when 'fromIndex' is -1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].lastIndexOf(4, -1) === 3; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].lastIndexOf(4, -1), 3, '[1, 2, 3, 4].lastIndexOf(4, -1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js index d882c9943..57e612701 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-7-3 description: > Array.prototype.lastIndexOf returns -1 when abs('fromIndex') is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].lastIndexOf(3, -3) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].lastIndexOf(3, -3), -1, '[1, 2, 3, 4].lastIndexOf(3, -3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js index c695f01b2..973e668e6 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-7-4 description: > Array.prototype.lastIndexOf returns -1 when abs('fromIndex') is length of array -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].lastIndexOf(2, -4) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].lastIndexOf(2, -4), -1, '[1, 2, 3, 4].lastIndexOf(2, -4)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js index c73193e7e..8798a9405 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-8-b-1 description: Array.prototype.lastIndexOf - undefined property wouldn't be called -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, , 2].lastIndexOf(undefined) === -1; - } -runTestCase(testcase); +assert.sameValue([0, , 2].lastIndexOf(undefined), -1, '[0, , 2].lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js index 0ca10fbfe..9d2ac61af 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js @@ -6,12 +6,8 @@ es5id: 15.4.4.15-8-b-i-2 description: > Array.prototype.lastIndexOf - element to be retrieved is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - return [true, true, true].lastIndexOf(true) === 2 && - [true, true, false].lastIndexOf(true) === 1 && - [true, false, false].lastIndexOf(true) === 0; - } -runTestCase(testcase); +assert.sameValue([true, true, true].lastIndexOf(true), 2, '[true, true, true].lastIndexOf(true)'); +assert.sameValue([true, true, false].lastIndexOf(true), 1, '[true, true, false].lastIndexOf(true)'); +assert.sameValue([true, false, false].lastIndexOf(true), 0, '[true, false, false].lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js index c51130912..a506afb15 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js @@ -6,16 +6,11 @@ es5id: 15.4.4.15-8-b-ii-1 description: > Array.prototype.lastIndexOf - type of array element is different from type of search element -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["true"].lastIndexOf(true) === -1 && - ["0"].lastIndexOf(0) === -1 && - [false].lastIndexOf(0) === -1 && - [undefined].lastIndexOf(0) === -1 && - [null].lastIndexOf(0) === -1 && - [[]].lastIndexOf(0) === -1; - } -runTestCase(testcase); +assert.sameValue(["true"].lastIndexOf(true), -1, '["true"].lastIndexOf(true)'); +assert.sameValue(["0"].lastIndexOf(0), -1, '["0"].lastIndexOf(0)'); +assert.sameValue([false].lastIndexOf(0), -1, '[false].lastIndexOf(0)'); +assert.sameValue([undefined].lastIndexOf(0), -1, '[undefined].lastIndexOf(0)'); +assert.sameValue([null].lastIndexOf(0), -1, '[null].lastIndexOf(0)'); +assert.sameValue([[]].lastIndexOf(0), -1, '[[]].lastIndexOf(0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js index 5d05f5291..a4fe50c44 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-10 description: > Array.prototype.lastIndexOf - both array element and search element are booleans, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [false, true].lastIndexOf(true) === 1; - } -runTestCase(testcase); +assert.sameValue([false, true].lastIndexOf(true), 1, '[false, true].lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js index 0024fe08a..c0e766e26 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js @@ -6,11 +6,7 @@ es5id: 15.4.4.15-8-b-ii-2 description: > Array.prototype.lastIndexOf - both type of array element and type of search element are Undefined -includes: [runTestCase.js] ---*/ -function testcase() { - - return [undefined].lastIndexOf() === 0 && [undefined].lastIndexOf(undefined) === 0; - } -runTestCase(testcase); +assert.sameValue([undefined].lastIndexOf(), 0, '[undefined].lastIndexOf()'); +assert.sameValue([undefined].lastIndexOf(undefined), 0, '[undefined].lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js index 2f90ee54e..53d1aa1d9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-3 description: > Array.prototype.lastIndexOf - both type of array element and type of search element are Null -includes: [runTestCase.js] ---*/ -function testcase() { - - return [null].lastIndexOf(null) === 0; - } -runTestCase(testcase); +assert.sameValue([null].lastIndexOf(null), 0, '[null].lastIndexOf(null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js index 466aaf110..fa9ff7be6 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-8-b-ii-4 description: Array.prototype.lastIndexOf - search element is NaN -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+NaN, NaN, -NaN].lastIndexOf(NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].lastIndexOf(NaN), -1, '[+NaN, NaN, -NaN].lastIndexOf(NaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js index 847952193..5ee7ff43e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js @@ -4,10 +4,6 @@ /*--- es5id: 15.4.4.15-8-b-ii-5 description: Array.prototype.lastIndexOf - search element is -NaN -includes: [runTestCase.js] ---*/ -function testcase() { - return [+NaN, NaN, -NaN].lastIndexOf(-NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].lastIndexOf(-NaN), -1, '[+NaN, NaN, -NaN].lastIndexOf(-NaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js index 14e29da77..722ae58b7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-6 description: > Array.prototype.lastIndexOf - array element is +0 and search element is -0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+0].lastIndexOf(-0) === 0; - } -runTestCase(testcase); +assert.sameValue([+0].lastIndexOf(-0), 0, '[+0].lastIndexOf(-0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js index 39aa8c6e1..1cc26df7a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-7 description: > Array.prototype.lastIndexOf - array element is -0 and search element is +0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-0].lastIndexOf(+0) === 0; - } -runTestCase(testcase); +assert.sameValue([-0].lastIndexOf(+0), 0, '[-0].lastIndexOf(+0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js index 1132490d3..96c979125 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-8 description: > Array.prototype.lastIndexOf - both array element and search element are numbers, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-1, 0, 1].lastIndexOf(-1) === 0; - } -runTestCase(testcase); +assert.sameValue([-1, 0, 1].lastIndexOf(-1), 0, '[-1, 0, 1].lastIndexOf(-1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js index 2beb5cb24..2814fe5bf 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js @@ -7,11 +7,6 @@ description: > Array.prototype.lastIndexOf - both array element and search element are strings, and they have exactly the same sequence of characters -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["abc", "ab", "bca", ""].lastIndexOf("abc") === 0; - } -runTestCase(testcase); +assert.sameValue(["abc", "ab", "bca", ""].lastIndexOf("abc"), 0, '["abc", "ab", "bca", ""].lastIndexOf("abc")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js index 974ae4a04..df2078182 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-iii-1 description: > Array.prototype.lastIndexOf returns index of last one when more than two elements in array are eligible -includes: [runTestCase.js] ---*/ -function testcase() { - - return [2, 1, 2, 2, 1].lastIndexOf(2) === 3; - } -runTestCase(testcase); +assert.sameValue([2, 1, 2, 2, 1].lastIndexOf(2), 3, '[2, 1, 2, 2, 1].lastIndexOf(2)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js index 8e1a61839..06f271c97 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js @@ -6,16 +6,7 @@ es5id: 15.4.4.21-7-1 description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (empty array) -includes: [runTestCase.js] ---*/ -function testcase() { function cb(){} - - try { - if([].reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue([].reduce(cb,1), 1, '[].reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js index ce0b9aac2..5354dfa85 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.21-7-10 description: Array.prototype.reduce - 'initialValue' is present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is present"; - return str === [].reduce(function () { }, str); - } -runTestCase(testcase); + +assert.sameValue([].reduce(function () { }, str), str, '[].reduce(function () { }, str)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js index b6b99ce1b..fbda9e9eb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.21-7-11 description: Array.prototype.reduce - 'initialValue' is not present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is not present"; - return str === [str].reduce(function () { }); - } -runTestCase(testcase); + +assert.sameValue([str].reduce(function () { }), str, '[str].reduce(function () { })'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js index 73ae44d16..16a9fbcd7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to null (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = null; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js index 9ea1a314b..552d32da6 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to false (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = false; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js index 9d90eb60c..696d3cdad 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to 0 (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = 0; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js index 864bb4dc4..ffc5f1870 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to '0' (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = '0'; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js index bfeab2ce6..e00c883a0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj with valueOf) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -19,10 +17,4 @@ function testcase() { f.length = o; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js index 991e6aea1..ca1d17e24 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj w/o valueOf (toString)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -25,10 +23,4 @@ function testcase() { // resulting string to a number. function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js index aefe0c3da..1ee25dae5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with []) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js index 4b732ef59..e52de88c9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with [0]) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js index 95f3d7c24..94e5a5e85 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-ii-1 description: > Array.prototype.reduce - added properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { }; Object.defineProperty(obj, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return Array.prototype.reduce.call(obj, function () { }) === "accumulator"; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, function () { }), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js index e1c79f25a..81ac5c517 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-ii-2 description: > Array.prototype.reduce - deleted properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: "accumulator", 2: "another" }; Object.defineProperty(obj, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return "accumulator" !== Array.prototype.reduce.call(obj, function () { }); - } -runTestCase(testcase); +assert.notSameValue(Array.prototype.reduce.call(obj, function () { }), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js index b143a1556..9c3ff7132 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js @@ -6,12 +6,8 @@ es5id: 15.4.4.22-5-9 description: > Array.prototype.reduceRight - 'initialValue' is returned if 'len' is 0 and 'initialValue' is present -includes: [runTestCase.js] ---*/ -function testcase() { - var initialValue = 10; - return initialValue === [].reduceRight(function () { }, initialValue); - } -runTestCase(testcase); + +assert.sameValue([].reduceRight(function () { }, initialValue), initialValue, '[].reduceRight(function () { }, initialValue)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js index dafb24ae8..c02fb4000 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js @@ -6,16 +6,7 @@ es5id: 15.4.4.22-7-1 description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (empty array) -includes: [runTestCase.js] ---*/ -function testcase() { function cb(){} - - try { - if([].reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue([].reduceRight(cb,1), 1, '[].reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js index 4b1bb71cb..fbd5ad19e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.22-7-10 description: Array.prototype.reduceRight - 'initialValue' is present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is present"; - return str === [].reduceRight(function () { }, str); - } -runTestCase(testcase); + +assert.sameValue([].reduceRight(function () { }, str), str, '[].reduceRight(function () { }, str)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js index ec4e4b800..d1c2db342 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.22-7-11 description: Array.prototype.reduceRight - 'initialValue' is not present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is not present"; - return str === [str].reduceRight(function () { }); - } -runTestCase(testcase); + +assert.sameValue([str].reduceRight(function () { }), str, '[str].reduceRight(function () { })'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js index 129a07a01..6a2b04b16 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to null (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = null; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js index 0dea7b815..58accb212 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to false (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = false; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js index 5ee711423..bf4a4bbbb 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to 0 (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = 0; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js index 2f900f368..a344bd162 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to '0' (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = '0'; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js index cb8935552..4c561a34a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj with valueOf) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -19,10 +17,4 @@ function testcase() { f.length = o; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js index 2f3553709..dcc9f4eea 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj w/o valueOf (toString)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -25,10 +23,4 @@ function testcase() { // resulting string to a number. function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js index 9ef8c95c8..1bc3b1634 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with []) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js index 9484da5a6..40cdd279e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with [0]) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js index 156471b6d..7cfafc07f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-ii-2 description: > Array.prototype.reduceRight - deleted properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 2: "accumulator", 3: "another" }; Object.defineProperty(obj, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return "accumulator" !== Array.prototype.reduceRight.call(obj, function () { }); - } -runTestCase(testcase); +assert.notSameValue(Array.prototype.reduceRight.call(obj, function () { }), "accumulator", 'Array.prototype.reduceRight.call(obj, function () { })'); |