From df43797c70b77d4f74a0595315868485f6f816fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= <andre.bargull@gmail.com> Date: Thu, 6 Aug 2015 18:18:58 +0200 Subject: [PATCH] Replace runTestCase with assert helpers [test/built-ins/Array/prototype/reduce] --- .../Array/prototype/reduce/15.4.4.21-0-1.js | 9 ++------- .../Array/prototype/reduce/15.4.4.21-0-2.js | 8 +------- .../Array/prototype/reduce/15.4.4.21-1-11.js | 6 +----- .../Array/prototype/reduce/15.4.4.21-1-12.js | 6 +----- .../Array/prototype/reduce/15.4.4.21-1-14.js | 6 +----- .../Array/prototype/reduce/15.4.4.21-1-15.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-1-4.js | 6 +----- .../Array/prototype/reduce/15.4.4.21-1-6.js | 7 ++----- .../Array/prototype/reduce/15.4.4.21-1-7.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-1-8.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-1-9.js | 6 +----- .../Array/prototype/reduce/15.4.4.21-10-1.js | 18 +++++------------- .../Array/prototype/reduce/15.4.4.21-10-2.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-10-3.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-10-4.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-10-5.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-10-6.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-10-7.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-10-8.js | 11 +---------- .../Array/prototype/reduce/15.4.4.21-2-1.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-10.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-11.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-2-13.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-2-14.js | 9 ++------- .../Array/prototype/reduce/15.4.4.21-2-17.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-18.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-19.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-2.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-3.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-5.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-6.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-7.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-8.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-2-9.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-1.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-3-10.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-3-11.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-12.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-13.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-14.js | 9 ++------- .../Array/prototype/reduce/15.4.4.21-3-15.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-16.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-17.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-18.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-3-19.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-2.js | 8 +------- .../Array/prototype/reduce/15.4.4.21-3-20.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-21.js | 9 +++------ .../Array/prototype/reduce/15.4.4.21-3-23.js | 9 +++------ .../Array/prototype/reduce/15.4.4.21-3-24.js | 6 +----- .../Array/prototype/reduce/15.4.4.21-3-25.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-3.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-3-4.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-3-5.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-3-6.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-7.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-3-9.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-4-12.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-5-9.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-8-b-2.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-8-b-3.js | 10 ++++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-1.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-10.js | 7 ++----- .../prototype/reduce/15.4.4.21-8-b-iii-1-11.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-13.js | 7 ++----- .../prototype/reduce/15.4.4.21-8-b-iii-1-15.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-17.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-18.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-2.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-21.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-25.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-26.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-27.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-28.js | 7 +------ .../prototype/reduce/15.4.4.21-8-b-iii-1-29.js | 7 +------ .../prototype/reduce/15.4.4.21-8-b-iii-1-3.js | 7 +------ .../prototype/reduce/15.4.4.21-8-b-iii-1-30.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-31.js | 7 +------ .../prototype/reduce/15.4.4.21-8-b-iii-1-5.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-7.js | 8 ++------ .../prototype/reduce/15.4.4.21-8-b-iii-1-9.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-1.js | 7 ++----- .../Array/prototype/reduce/15.4.4.21-9-10.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-2.js | 10 ++-------- .../Array/prototype/reduce/15.4.4.21-9-4.js | 10 ++-------- .../Array/prototype/reduce/15.4.4.21-9-5.js | 10 +++------- .../Array/prototype/reduce/15.4.4.21-9-7.js | 8 +++----- .../Array/prototype/reduce/15.4.4.21-9-8.js | 9 +++------ .../Array/prototype/reduce/15.4.4.21-9-9.js | 7 ++----- .../Array/prototype/reduce/15.4.4.21-9-b-1.js | 9 +-------- .../Array/prototype/reduce/15.4.4.21-9-b-14.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-b-16.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-9-b-17.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-b-18.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-b-2.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-9-b-21.js | 9 +++------ .../Array/prototype/reduce/15.4.4.21-9-b-22.js | 9 +++------ .../Array/prototype/reduce/15.4.4.21-9-b-27.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-b-29.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-9-b-3.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-b-4.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-b-5.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-9-b-8.js | 9 +++------ .../Array/prototype/reduce/15.4.4.21-9-b-9.js | 9 +++------ .../Array/prototype/reduce/15.4.4.21-9-c-1.js | 10 +++------- .../prototype/reduce/15.4.4.21-9-c-i-1.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-10.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-11.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-13.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-15.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-17.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-18.js | 9 ++------- .../prototype/reduce/15.4.4.21-9-c-i-2.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-21.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-25.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-26.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-27.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-28.js | 9 ++------- .../prototype/reduce/15.4.4.21-9-c-i-29.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-3.js | 7 +------ .../prototype/reduce/15.4.4.21-9-c-i-30.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-31.js | 7 +------ .../prototype/reduce/15.4.4.21-9-c-i-5.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-7.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-i-9.js | 7 +------ .../prototype/reduce/15.4.4.21-9-c-ii-1.js | 9 ++------- .../prototype/reduce/15.4.4.21-9-c-ii-10.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-11.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-12.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-13.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-14.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-16.js | 10 ++++------ .../prototype/reduce/15.4.4.21-9-c-ii-17.js | 9 +++------ .../prototype/reduce/15.4.4.21-9-c-ii-18.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-19.js | 9 +++------ .../prototype/reduce/15.4.4.21-9-c-ii-2.js | 9 ++------- .../prototype/reduce/15.4.4.21-9-c-ii-20.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-21.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-22.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-23.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-24.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-25.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-26.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-27.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-28.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-29.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-3.js | 10 +++------- .../prototype/reduce/15.4.4.21-9-c-ii-30.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-31.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-32.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-33.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-34.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-35.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-37.js | 11 +++-------- .../prototype/reduce/15.4.4.21-9-c-ii-4-s.js | 7 ++----- .../prototype/reduce/15.4.4.21-9-c-ii-4.js | 9 +++------ .../prototype/reduce/15.4.4.21-9-c-ii-5.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-8.js | 8 ++------ .../prototype/reduce/15.4.4.21-9-c-ii-9.js | 8 ++------ 159 files changed, 291 insertions(+), 978 deletions(-) diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js index f9ed27c78e..b6a168723e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.21-0-1 description: Array.prototype.reduce must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Array.prototype.reduce; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js index 5df27324c9..06afb159dd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.4.4.21-0-2 description: Array.prototype.reduce.length must be 1 -includes: [runTestCase.js] ---*/ -function testcase() { - if (Array.prototype.reduce.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.length, 1, 'Array.prototype.reduce.length'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js index 47df4a005e..3c7a850ef2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-11.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.21-1-11 description: Array.prototype.reduce applied to Date object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Date; } @@ -16,6 +14,4 @@ function testcase() { obj.length = 1; obj[0] = 1; - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js index 6c7e916d64..e107e890fd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-12.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.21-1-12 description: Array.prototype.reduce applied to RegExp object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof RegExp; } @@ -16,6 +14,4 @@ function testcase() { obj.length = 1; obj[0] = 1; - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js index d14c442e2e..26d6b9067a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-14.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.21-1-14 description: Array.prototype.reduce applied to Error object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Error; } @@ -16,6 +14,4 @@ function testcase() { obj.length = 1; obj[0] = 1; - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js index 726a931c83..856b8fc76f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-15.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-1-15 description: Array.prototype.reduce applied to the Arguments object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return ('[object Arguments]' === Object.prototype.toString.call(obj)); } @@ -17,6 +14,4 @@ function testcase() { return arguments; }("a", "b")); - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js index d09aebad48..c32bd16246 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-4.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.21-1-4 description: Array.prototype.reduce applied to Boolean object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Boolean; } @@ -17,6 +15,4 @@ function testcase() { obj[0] = 11; obj[1] = 12; - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js index 137efb0b47..d9a979e1bb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-6.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.21-1-6 description: Array.prototype.reduce applied to Number object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Number; } @@ -16,6 +14,5 @@ function testcase() { obj.length = 2; obj[0] = 11; obj[1] = 12; - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); + +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js index 9cc9e35843..3f69d45217 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-7.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.21-1-7 description: Array.prototype.reduce applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof String; } - return Array.prototype.reduce.call("abc", callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call("abc", callbackfn, 1), 'Array.prototype.reduce.call("abc", callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js index aa6377c36e..714bfbb4de 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-8.js @@ -4,17 +4,12 @@ /*--- es5id: 15.4.4.21-1-8 description: Array.prototype.reduce applied to String object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof String; } var obj = new String("abc"); - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js index 9c8cf1dfdb..e6ccb13a7c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-9.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.21-1-9 description: Array.prototype.reduce applied to Function object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Function; } @@ -18,6 +16,4 @@ function testcase() { obj[0] = 11; obj[1] = 9; - return Array.prototype.reduce.call(obj, callbackfn, 1); - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(obj, callbackfn, 1), 'Array.prototype.reduce.call(obj, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js index c0d3668f66..3e1de73b4e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-1.js @@ -6,25 +6,17 @@ es5id: 15.4.4.21-10-1 description: > Array.prototype.reduce doesn't mutate the Array on which it is called on -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return 1; } var srcArr = [1,2,3,4,5]; srcArr.reduce(callbackfn); - if(srcArr[0] === 1 && - srcArr[1] === 2 && - srcArr[2] === 3 && - srcArr[3] === 4 && - srcArr[4] === 5) - { - return true; - } - } -runTestCase(testcase); +assert.sameValue(srcArr[0], 1, 'srcArr[0]'); +assert.sameValue(srcArr[1], 2, 'srcArr[1]'); +assert.sameValue(srcArr[2], 3, 'srcArr[2]'); +assert.sameValue(srcArr[3], 4, 'srcArr[3]'); +assert.sameValue(srcArr[4], 5, 'srcArr[4]'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js index 81eca4210a..8cdc8eebba 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-2.js @@ -6,20 +6,12 @@ es5id: 15.4.4.21-10-2 description: > Array.prototype.reduce reduces the array in ascending order of indices -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return prevVal + curVal; } var srcArr = ['1','2','3','4','5']; - if(srcArr.reduce(callbackfn) === '12345') - { - return true; - } - } -runTestCase(testcase); +assert.sameValue(srcArr.reduce(callbackfn), '12345', 'srcArr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js index 87784f561d..ac6b33700d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-3.js @@ -4,16 +4,12 @@ /*--- es5id: 15.4.4.21-10-3 description: Array.prototype.reduce - subclassed array of length 1 -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = [1]; function foo() {} var f = new foo(); function cb(){} - if(f.reduce(cb) === 1) - return true; - } -runTestCase(testcase); + +assert.sameValue(f.reduce(cb), 1, 'f.reduce(cb)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js index 6b387e091b..eb3928eca5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-4.js @@ -4,16 +4,12 @@ /*--- es5id: 15.4.4.21-10-4 description: Array.prototype.reduce - subclassed array with length more than 1 -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3, 4); function foo() {} var f = new foo(); function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} - if(f.reduce(cb) === 10) - return true; - } -runTestCase(testcase); + +assert.sameValue(f.reduce(cb), 10, 'f.reduce(cb)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js index 2cbe4bb8de..a406a1ed83 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-5.js @@ -6,20 +6,12 @@ es5id: 15.4.4.21-10-5 description: > Array.prototype.reduce reduces the array in ascending order of indices(initialvalue present) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return prevVal + curVal; } var srcArr = ['1','2','3','4','5']; - if(srcArr.reduce(callbackfn,'0') === '012345') - { - return true; - } - } -runTestCase(testcase); +assert.sameValue(srcArr.reduce(callbackfn,'0'), '012345', 'srcArr.reduce(callbackfn,"0")'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js index e53b35ca06..1678a86314 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-6.js @@ -6,16 +6,12 @@ es5id: 15.4.4.21-10-6 description: > Array.prototype.reduce - subclassed array when initialvalue provided -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = [1,2,3,4]; function foo() {} var f = new foo(); function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} - if(f.reduce(cb,-1) === 9) - return true; - } -runTestCase(testcase); + +assert.sameValue(f.reduce(cb,-1), 9, 'f.reduce(cb,-1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js index dcbe93842c..bb61651893 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-7.js @@ -6,16 +6,12 @@ es5id: 15.4.4.21-10-7 description: > Array.prototype.reduce - subclassed array with length 1 and initialvalue provided -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = [1]; function foo() {} var f = new foo(); function cb(prevVal, curVal, idx, obj){return prevVal + curVal;} - if(f.reduce(cb,-1) === 0) - return true; - } -runTestCase(testcase); + +assert.sameValue(f.reduce(cb,-1), 0, 'f.reduce(cb,-1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js index 86aa67a1b9..754e312902 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-10-8.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-10-8 description: Array.prototype.reduce doesn't visit expandos -includes: [runTestCase.js] ---*/ -function testcase() { - var callCnt = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,10 +17,4 @@ function testcase() { srcArr[true] = 11; srcArr.reduce(callbackfn); - if(callCnt == 4) - { - return true; - } - - } -runTestCase(testcase); +assert.sameValue(callCnt, 4, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js index 88296c03e4..7653134cb5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-1 description: > Array.prototype.reduce - 'length' is own data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -22,6 +19,4 @@ function testcase() { length: 2 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js index f9d57dd589..ab09f8ea17 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-10 description: > Array.prototype.reduce applied to Array-like object, 'length' is an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -32,6 +29,4 @@ function testcase() { child[1] = 11; child[2] = 9; - return Array.prototype.reduce.call(child, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js index c5aaaa67a6..40657d6c1b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-11 description: > Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -25,6 +22,5 @@ function testcase() { configurable: true }); - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js index 919647eda7..7697a8bcdb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-13 description: > Array.prototype.reduce applied to Array-like object that 'length' is inherited accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -30,6 +27,5 @@ function testcase() { child[0] = 11; child[1] = 12; - return Array.prototype.reduce.call(child, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), 1, 'Array.prototype.reduce.call(child, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js index 616d481ec4..c82e171030 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-14 description: > Array.prototype.reduce applied to the Array-like object that 'length' property doesn't exist -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,5 @@ function testcase() { var obj = { 0: 11, 1: 12 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js index f0b58b0657..841c3266ec 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-17 description: > Array.prototype.reduce applied to the Arguments object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -20,6 +17,4 @@ function testcase() { return Array.prototype.reduce.call(arguments, callbackfn, 1); }; - return func(12, 11) === true; - } -runTestCase(testcase); +assert.sameValue(func(12, 11), true, 'func(12, 11)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js index 39c7fb90f9..9f72d44be3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-18.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-2-18 description: > Array.prototype.reduce applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 3); } var str = new String("012"); - return Array.prototype.reduce.call(str, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(str, callbackfn, 1), true, 'Array.prototype.reduce.call(str, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js index b5a6fc1041..2affbf2667 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-19 description: > Array.prototype.reduce applied to Function object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -22,6 +19,4 @@ function testcase() { fun[1] = 11; fun[2] = 9; - return Array.prototype.reduce.call(fun, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(fun, callbackfn, 1), true, 'Array.prototype.reduce.call(fun, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js index d5b04de32a..dfd1d93fea 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-2.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.21-2-2 description: Array.prototype.reduce - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } - return [12, 11].reduce(callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue([12, 11].reduce(callbackfn, 1), true, '[12, 11].reduce(callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js index 6a3a47cdd3..fb9124117c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-3 description: > Array.prototype.reduce - 'length' is an own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -26,6 +23,4 @@ function testcase() { child[1] = 11; child[2] = 9; - return Array.prototype.reduce.call(child, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js index c9cd2af88b..7d5b5c4b95 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-5 description: > Array.prototype.reduce applied to Array-like object, 'length' is an own data property that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -36,6 +33,4 @@ function testcase() { child[1] = 11; child[2] = 9; - return Array.prototype.reduce.call(child, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js index a78487cff7..03acf1257c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-6 description: > Array.prototype.reduce applied to Array-like object, 'length' is an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -25,6 +22,4 @@ function testcase() { child[1] = 11; child[2] = 9; - return Array.prototype.reduce.call(child, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js index adbabf8ce1..041084fc9a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-7 description: > Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -28,6 +25,4 @@ function testcase() { obj[1] = 11; obj[2] = 9; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js index 099169a679..fc1b7ddccc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-2-8 description: > Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property that overrides an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -33,6 +30,4 @@ function testcase() { child[1] = 11; child[2] = 9; - return Array.prototype.reduce.call(child, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js index 3573898f33..bb13c5fdcc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-9.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce applied to Array-like object, 'length' is an own accessor property that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } @@ -41,6 +38,4 @@ function testcase() { child[1] = 11; child[2] = 9; - return Array.prototype.reduce.call(child, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(child, callbackfn, 1), true, 'Array.prototype.reduce.call(child, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js index 65889e7305..37934077df 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-1.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-3-1 description: Array.prototype.reduce - value of 'length' is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 0, 1: 1, length: undefined }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js index 8343d81ee9..a3f6cea74a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-10 description: > Array.prototype.reduce - value of 'length' is number primitive (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,6 +17,5 @@ function testcase() { var obj = { 0: 9, length: NaN }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js index d4ad07c5f7..31c311af83 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-11.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-11 description: > Array.prototype.reduce - 'length' is a string containing a positive number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: "2" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js index 2365eb653a..1707e5d421 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-12.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-12 description: > Array.prototype.reduce - 'length' is a string containing a negative number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: "-4294967294" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js index 8a8e950a3b..cc310f68ef 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-13.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-13 description: > Array.prototype.reduce - 'length' is a string containing a decimal number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: "2.5" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js index 424041eca3..2780fc4eeb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-14.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-3-14 description: Array.prototype.reduce - 'length' is a string containing -Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed2 = false; function callbackfn2(prevVal, curVal, idx, obj) { @@ -18,7 +15,5 @@ function testcase() { var obj2 = { 0: 9, length: "-Infinity" }; - return Array.prototype.reduce.call(obj2, callbackfn2, 1) === 1 - && !accessed2; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj2, callbackfn2, 1), 1, 'Array.prototype.reduce.call(obj2, callbackfn2, 1)'); +assert.sameValue(accessed2, false, 'accessed2'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js index 7def35b7b6..afc324344d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-15.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-15 description: > Array.prototype.reduce - 'length' is a string containing an exponential number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: "2E0" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js index 23804aa91c..9bbc9eeaa5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-16.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-16 description: > Array.prototype.reduce - 'length' is a string containing a hex number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: "0x0002" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js index 921445a8b1..690bbf7e14 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-17.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-17 description: > Array.prototype.reduce - 'length' is a string containing a number with leading zeros -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: "0002.00" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js index 845c3e77f3..a9080d0593 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-18 description: > Array.prototype.reduce - value of 'length' is a string that can't convert to a number -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 9, length: "asdf!_" }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js index 5943822b42..d585f3422d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-19 description: > Array.prototype.reduce - value of 'length' is an Object which has an own toString method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } @@ -25,6 +22,4 @@ function testcase() { } }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js index e4cd999a37..fd6781f5a5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-2.js @@ -6,18 +6,12 @@ es5id: 15.4.4.21-3-2 description: > Array.prototype.reduce - value of 'length' is a boolean (value is true) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 0); } var obj = { 0: 11, 1: 9, length: true }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js index 1db54db837..3bbdb55146 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-20 description: > Array.prototype.reduce - value of 'length' is an object which has an own valueOf method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } @@ -25,6 +22,4 @@ function testcase() { } }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js index 641f227acc..6df7cf31e7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-21.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - 'length' is an object that has an own valueOf method that returns an object and toString method that returns a string -includes: [runTestCase.js] ---*/ -function testcase() { - var valueOfOccured = false; var toStringOccured = false; @@ -34,6 +31,6 @@ function testcase() { } }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true && valueOfOccured && toStringOccured; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert(valueOfOccured, 'valueOfOccured !== true'); +assert(toStringOccured, 'toStringOccured !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js index 3db766290f..5231d12ffa 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-23.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-23 description: > Array.prototype.reduce uses inherited valueOf method - 'length' is an object with an own toString and inherited valueOf methods -includes: [runTestCase.js] ---*/ -function testcase() { - var valueOfAccessed = false; var toStringAccessed = false; @@ -41,6 +38,6 @@ function testcase() { length: child }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true && valueOfAccessed && !toStringAccessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(toStringAccessed, false, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js index c08fc1a659..ceaeabd196 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-24.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-3-24 description: > Array.prototype.reduce - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } @@ -20,6 +18,4 @@ function testcase() { length: 2.685 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js index 08eb40fa76..4728d9f4f4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-25.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-25 description: > Array.prototype.reduce - value of 'length' is a negative non-integer -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } @@ -21,6 +18,4 @@ function testcase() { length: -4294967294.5 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js index 50b23de4b8..f988b1dc8d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-3-3 description: Array.prototype.reduce - value of 'length' is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 1, 1: 1, length: 0 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js index 9806b73d4b..b6a0e3ba25 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-4 description: > Array.prototype.reduce - value of 'length' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,6 +17,5 @@ function testcase() { var obj = { 0: 11, length: +0 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js index f611533a11..dd3dc6159c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-5 description: > Array.prototype.reduce - value of 'length' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,6 +17,5 @@ function testcase() { var obj = { 0: 11, length: -0 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js index 200e9cf60c..8a307a43d1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-6.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-6 description: > Array.prototype.reduce - value of 'length' is a number (value is positive) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: 2 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === true; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), true, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js index 9532748865..9499dd414d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-7.js @@ -6,17 +6,12 @@ es5id: 15.4.4.21-3-7 description: > Array.prototype.reduce - value of 'length' is a number (value is negative) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal === 11 && idx === 1); } var obj = { 1: 11, 2: 9, length: -4294967294 }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js index 8943a19298..122c00077f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-3-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-3-9 description: > Array.prototype.reduce - value of 'length' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 9, length: -Infinity }; - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js index 68b217dec7..5d5da70f65 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-12.js @@ -4,17 +4,13 @@ /*--- es5id: 15.4.4.21-4-12 description: Array.prototype.reduce - 'callbackfn' is a function -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; return curVal > 10; } - return [11, 9].reduce(callbackfn, 1) === false && accessed; - } -runTestCase(testcase); +assert.sameValue([11, 9].reduce(callbackfn, 1), false, '[11, 9].reduce(callbackfn, 1)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js index 49eb6e0d36..294a20c492 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-9.js @@ -6,16 +6,12 @@ es5id: 15.4.4.21-5-9 description: > Array.prototype.reduce - 'initialValue' is returned if 'len' is 0 and 'initialValue' is present -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; } - return [].reduce(callbackfn, 3) === 3 && !accessed; - } -runTestCase(testcase); +assert.sameValue([].reduce(callbackfn, 3), 3, '[].reduce(callbackfn, 3)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js index 60a3e99770..58799e4c0f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-2 description: > Array.prototype.reduce - modifications to length don't change number of iterations in step 9 -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return idx; } @@ -25,6 +22,4 @@ function testcase() { configurable: true }); - return Array.prototype.reduce.call(obj, callbackfn) === 3; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn), 3, 'Array.prototype.reduce.call(obj, callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js index d9ecb6e2e4..a7d8312cbc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-8-b-3 description: Array.prototype.reduce - loop is broken once 'kPresent' is true -includes: [runTestCase.js] ---*/ -function testcase() { - var called = 0; var testResult = false; var firstCalled = 0; @@ -40,6 +37,7 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult && firstCalled === 1 && secondCalled === 1; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert.sameValue(firstCalled, 1, 'firstCalled'); +assert.sameValue(secondCalled, 1, 'secondCalled'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js index afa7bdf8e1..2015994b52 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-1 description: > Array.prototype.reduce - element to be retrieved is own data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,6 +17,5 @@ function testcase() { var obj = { 0: 0, 1: 1, 2: 2, length: 2 }; Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js index 6529df29b4..afd039d95c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-10.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-10 description: > Array.prototype.reduce - when element to be retrieved is own accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -28,6 +26,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js index d3a2d8e523..749849c5ce 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-11.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -35,6 +32,5 @@ function testcase() { }); Array.prototype.reduce.call(child, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js index 267ba2a338..a1d8b0ae54 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-13.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -42,6 +40,5 @@ function testcase() { }); Array.prototype.reduce.call(child, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js index 4bf79ff7bd..4e88911dc7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-15 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -34,6 +31,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js index fc535d6ad8..df24619032 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-17 description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -26,6 +23,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js index 836b0f764f..56d7265b80 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-18 description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -26,6 +23,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js index 248d8441b0..95847b6205 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-2 description: > Array.prototype.reduce - element to be retrieved is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,6 +17,5 @@ function testcase() { var arr = [0, 1, 2]; arr.reduce(callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js index 9bc6297980..a819487734 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-21.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-21 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -32,6 +29,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js index f806300bb2..ffc348e3b1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is less than number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -24,6 +21,5 @@ function testcase() { }; func(0, 1); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js index 913112c7e5..77cf2e2059 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-26.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 2) { @@ -25,6 +22,5 @@ function testcase() { }; func(0, 1, 2); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js index 75cfe2b640..79cf151db4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-27.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is greater than number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 3) { @@ -26,6 +23,5 @@ function testcase() { }; func(0, 1, 2, 3); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js index 94325f7c81..451cf864fb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-28 description: > Array.prototype.reduce - applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,7 +17,5 @@ function testcase() { var str = new String("012"); Array.prototype.reduce.call(str, callbackfn); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js index 7592901dca..ead6d3bbcb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-29 description: > Array.prototype.reduce - applied to Function object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -27,7 +24,5 @@ function testcase() { obj[3] = 3; Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js index 1e98797a9a..c110f39fef 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-3.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -29,7 +26,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js index 3c611a8d09..5b44c264eb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-30 description: > Array.prototype.reduce - element changed by getter on current iterations is observed in subsequent iterations on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -41,6 +38,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js index 2f4076f1b8..84ebb33406 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-31.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element changed by getter on current iterations is observed in subsequent iterations on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -42,7 +39,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js index d8db9e89aa..d9f5cd35dd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-5.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -40,6 +37,5 @@ function testcase() { child[1] = "1"; Array.prototype.reduce.call(child, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js index e72682d8c2..6abc1c045b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-7 description: > Array.prototype.reduce - element to be retrieved is inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -26,6 +23,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js index a7cb749e30..2226c04b2c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-9 description: > Array.prototype.reduce - element to be retrieved is own accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -27,6 +24,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js index 8b7b014c15..97a2f04fa0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-1.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-9-1 description: > Array.prototype.reduce doesn't consider new elements added to array after it is called -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { arr[5] = 6; arr[2] = 3; @@ -17,6 +15,5 @@ function testcase() { } var arr = [1, 2, , 4, '5']; - return arr.reduce(callbackfn) === "105"; - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn), "105", 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js index 9746e1cbf1..f5a45d6607 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-10 description: > Array.prototype.reduce called with an initial value doesn't consider new elements added to array after it is called -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { arr[5] = 6; arr[2] = 3; @@ -18,6 +15,5 @@ function testcase() { } var arr = [1,2,,4,'5']; - return arr.reduce(callbackfn, "") === "12345"; - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn, ""), "12345", 'arr.reduce(callbackfn, "")'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js index 00a8baf1d4..0999bcdc82 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-2 description: > Array.prototype.reduce considers new value of elements in array after it is called -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { arr[3] = -2; @@ -19,8 +16,5 @@ function testcase() { } var arr = [1,2,3,4,5]; - if(arr.reduce(callbackfn) === 3) - return true; - - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn), 3, 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js index e901425984..b183adfbd0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-4 description: > Array.prototype.reduce doesn't visit deleted elements when Array.length is decreased -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { arr.length = 2; @@ -18,8 +15,5 @@ function testcase() { } var arr = [1,2,3,4,5]; - if(arr.reduce(callbackfn) === 3 ) - return true; - - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn), 3, 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js index 8676b3e380..c6e96e9a71 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-5 description: > Array.prototype.reduce - callbackfn not called for array with one element -includes: [runTestCase.js] ---*/ -function testcase() { - var callCnt = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } var arr = [1]; - if(arr.reduce(callbackfn) === 1 && callCnt === 0 ) - return true; - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn), 1, 'arr.reduce(callbackfn)'); +assert.sameValue(callCnt, 0, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js index 07285709e2..9f6baab99d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-9-7 description: > Array.prototype.reduce stops calling callbackfn once the array is deleted during the call -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { delete o.arr; return prevVal + curVal; @@ -17,6 +15,6 @@ function testcase() { var o = new Object(); o.arr = ['1', 2, 3, 4, 5]; - return o.arr.reduce(callbackfn) === "12345" && !o.hasOwnProperty("arr"); - } -runTestCase(testcase); + +assert.sameValue(o.arr.reduce(callbackfn), "12345", 'o.arr.reduce(callbackfn)'); +assert.sameValue(o.hasOwnProperty("arr"), false, 'o.hasOwnProperty("arr")'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js index d2b3969801..66dd77475c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-8.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-8 description: Array.prototype.reduce - no observable effects occur if 'len' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var callbackAccessed = false; function callbackfn() { @@ -26,6 +23,6 @@ function testcase() { }); Array.prototype.reduce.call(obj, function () { }, "initialValue"); - return !accessed && !callbackAccessed; - } -runTestCase(testcase); + +assert.sameValue(accessed, false, 'accessed'); +assert.sameValue(callbackAccessed, false, 'callbackAccessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js index bd97d824f3..ccf92a2d63 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-9.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-9-9 description: > Array.prototype.reduce - modifications to length don't change number of iterations in step 9 -includes: [runTestCase.js] ---*/ -function testcase() { var called = 0; function callbackfn(accum, val, idx, obj) { called++; @@ -27,6 +25,5 @@ function testcase() { var newAccum = arr.reduce(callbackfn, "initialValue"); - return newAccum === "initialValue01" && called === 2; - } -runTestCase(testcase); +assert.sameValue(newAccum, "initialValue01", 'newAccum'); +assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js index 5b50b02265..4a79904982 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-1.js @@ -6,19 +6,12 @@ es5id: 15.4.4.21-9-b-1 description: > Array.prototype.reduce returns initialvalue when Array is empty and initialValue is present -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { } var arr = new Array(10); - if(arr.reduce(callbackfn,5) === 5) - return true; - - } -runTestCase(testcase); +assert.sameValue(arr.reduce(callbackfn,5), 5, 'arr.reduce(callbackfn,5)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js index 7eb49ee790..3ec5f11618 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-14 description: > Array.prototype.reduce - decreasing length of array in step 8 causes deleted index property not to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -33,6 +30,5 @@ function testcase() { arr.reduce(callbackfn); - return testResult && accessed; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js index 9737b81204..880948afe4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-16.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - decreasing length of array in step 8 does not delete non-configurable properties flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -39,6 +36,4 @@ function testcase() { arr.reduce(callbackfn); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js index e86b5b32bf..d113edf659 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-17 description: > Array.prototype.reduce - properties added into own object are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -35,6 +32,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js index e1c0178ed5..fdd1232bef 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-18 description: > Array.prototype.reduce - properties added into own object are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -35,6 +32,5 @@ function testcase() { }); arr.reduce(callbackfn, "initialValue"); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js index fb21cd6686..76ec6be5a1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-2 description: > Array.prototype.reduce - added properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -31,6 +28,4 @@ function testcase() { Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js index 1df76b4a82..9f622a0bca 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-21.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-21 description: > Array.prototype.reduce - deleting own property causes deleted index property not to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -39,6 +36,6 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult && accessed; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js index dd7b9f67bb..d276ff1f45 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-22 description: > Array.prototype.reduce - deleting own property causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -39,6 +36,6 @@ function testcase() { }); arr.reduce(callbackfn, "initialValue"); - return testResult && accessed; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js index 3f5ff89337..fa0595364a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-27.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-27 description: > Array.prototype.reduce - decreasing length of array causes deleted index property not to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -33,6 +30,5 @@ function testcase() { arr.reduce(callbackfn, "initialValue"); - return testResult && accessed; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js index 83ef0cbc82..4a1d058755 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-29.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - decreasing length of array does not delete non-configurable properties flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -39,6 +36,4 @@ function testcase() { arr.reduce(callbackfn, "initialValue"); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js index 7d36a853a8..e25a0c8bcf 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-3 description: > Array.prototype.reduce - deleted properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -33,6 +30,5 @@ function testcase() { Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return accessed && testResult; - } -runTestCase(testcase); +assert(accessed, 'accessed !== true'); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js index 21d48f2cba..eb1a8e37c1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-4 description: > Array.prototype.reduce - properties added into own object in step 8 are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -35,6 +32,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js index 71e49118e6..b045c3346f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-5 description: > Array.prototype.reduce - properties added into own object in step 8 are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -35,6 +32,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js index 5ff818e4f4..c9ae451a90 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-8 description: > Array.prototype.reduce - deleting own property in step 8 causes deleted index property not to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -39,6 +36,6 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn); - return testResult && accessed; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js index fd8d2ab0ef..38291cd271 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-9 description: > Array.prototype.reduce - deleting own property in step 8 causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -32,6 +29,6 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult && accessed; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js index aa2bfbfb36..2c5673ea99 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-1 description: > Array.prototype.reduce - callbackfn not called for indexes never been assigned values -includes: [runTestCase.js] ---*/ -function testcase() { - var callCnt = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { var arr = new Array(10); arr[0] = arr[1] = undefined; //explicitly assigning a value - if( arr.reduce(callbackfn) === undefined && callCnt === 1) - return true; - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn), undefined, 'arr.reduce(callbackfn)'); +assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js index edbce72d25..c5d969c15d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-1 description: > Array.prototype.reduce - element to be retrieved is own data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -21,6 +18,5 @@ function testcase() { var obj = { 0: 0, 1: 1, 2: 2, length: 2 }; Array.prototype.reduce.call(obj, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js index f1d1e3436d..5abbe780af 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-10 description: > Array.prototype.reduce - element to be retrieved is own accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -29,6 +26,5 @@ function testcase() { }); arr.reduce(callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js index 875342dd9b..54332b569c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-11.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -36,6 +33,5 @@ function testcase() { }); Array.prototype.reduce.call(child, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js index befe7caf4a..2faa0cca6f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-13.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -43,6 +40,5 @@ function testcase() { }); Array.prototype.reduce.call(child, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js index 01d48876ac..54e70886e3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-15 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -35,6 +32,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js index b33016a898..aaf664665e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-17 description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -27,6 +24,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js index 525faa40da..a4f82d024c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-18 description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -27,7 +24,5 @@ function testcase() { }); arr.reduce(callbackfn, initialValue); - return testResult; - - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js index b37f46f132..5e6915028c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-2 description: > Array.prototype.reduce - element to be retrieved is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -21,6 +18,5 @@ function testcase() { var arr = [0, 1]; arr.reduce(callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js index db05c388b1..350e6c04e8 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-21.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-21 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -33,6 +30,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js index 0cbb4cd844..6ae39b9677 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is less than number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -25,6 +22,5 @@ function testcase() { }; func(0, 1); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js index 82999096b3..fa9b3d46c7 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-26.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments equals number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -25,6 +22,5 @@ function testcase() { }; func(0, 1, 2); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js index c661636771..bd13966d9e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-27.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - This object is the Arguments object which implements its own property get method (number of arguments is greater than number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -25,6 +22,5 @@ function testcase() { }; func(0, 1, 2, 3); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js index 0795014a51..59459ffa6f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-28 description: > Array.prototype.reduce - applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -22,7 +19,5 @@ function testcase() { var str = new String("012"); Array.prototype.reduce.call(str, callbackfn, initialValue); - return testResult; - - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js index c0d326e4fc..eb4d19cfe9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-29 description: > Array.prototype.reduce - applied to Function object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -28,6 +25,5 @@ function testcase() { obj[3] = 3; Array.prototype.reduce.call(obj, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js index 9ad289384b..44f136d10b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-3.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -30,7 +27,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js index a7d94e4f3e..da35414d3f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-30.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-30 description: > Array.prototype.reduce - element changed by getter on previous iterations is observed on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -42,6 +39,5 @@ function testcase() { }); arr.reduce(callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js index 1bcce7f114..852b4289e9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-31.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-31 description: > Array.prototype.reduce - element changed by getter on previous iterations is observed on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -42,7 +39,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js index f8e08c1a97..cacb0e36b6 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-5.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -43,6 +40,5 @@ function testcase() { child[1] = "1"; Array.prototype.reduce.call(child, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js index 4e0dbb2999..90e6a56774 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-7 description: > Array.prototype.reduce - element to be retrieved is inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -27,6 +24,5 @@ function testcase() { child.length = 3; Array.prototype.reduce.call(child, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js index 86c84f0cae..a7f92f8b69 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-9 description: > Array.prototype.reduce - element to be retrieved is own accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -28,7 +25,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn, initialValue); - return testResult; - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js index 3a96b3f729..18fe4e63c0 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-1 description: > Array.prototype.reduce - callbackfn called with correct parameters (initialvalue not passed) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { if(idx > 0 && obj[idx] === curVal && obj[idx-1] === prevVal) @@ -20,7 +17,5 @@ function testcase() { } var arr = [0,1,true,null,new Object(),"five"]; - if( arr.reduce(callbackfn) === "five") - return true; - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn), "five", 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js index 68646c07cf..de1864bc90 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-10.js @@ -6,17 +6,13 @@ es5id: 15.4.4.21-9-c-ii-10 description: > Array.prototype.reduce - callbackfn is called with 1 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; function callbackfn(prevVal) { result = (prevVal === 1); } [11].reduce(callbackfn, 1); - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js index 44070bdbe1..33fb22ec30 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-11.js @@ -6,17 +6,13 @@ es5id: 15.4.4.21-9-c-ii-11 description: > Array.prototype.reduce - callbackfn is called with 2 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; function callbackfn(prevVal, curVal) { result = (curVal > 10 && 1 === prevVal); } [11].reduce(callbackfn, 1); - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js index 42407c4e44..26b296baec 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-12.js @@ -6,17 +6,13 @@ es5id: 15.4.4.21-9-c-ii-12 description: > Array.prototype.reduce - callbackfn is called with 3 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; function callbackfn(prevVal, curVal, idx) { result = (prevVal === 1 && arguments[3][idx] === curVal); } [11].reduce(callbackfn, 1); - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js index ad0e086ce3..6f148ee490 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-13.js @@ -6,17 +6,13 @@ es5id: 15.4.4.21-9-c-ii-13 description: > Array.prototype.reduce - callbackfn is called with 4 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; function callbackfn(prevVal, curVal, idx, obj) { result = (prevVal === 1 && obj[idx] === curVal); } [11].reduce(callbackfn, 1); - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js index 81c879421c..f6ac6ab952 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-14.js @@ -4,17 +4,13 @@ /*--- es5id: 15.4.4.21-9-c-ii-14 description: Array.prototype.reduce - callbackfn that uses arguments -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; function callbackfn() { result = (arguments[0] === 1 && arguments[3][arguments[2]] === arguments[1]); } [11].reduce(callbackfn, 1); - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js index 7bad0ecfe3..51516da72e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-16.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-16 description: Array.prototype.reduce - non-indexed properties are not called -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var result1 = true; var result2 = true; @@ -27,6 +24,7 @@ function testcase() { var obj = { 0: 11, 10: 12, non_index_property: 8, length: 20 }; Array.prototype.reduce.call(obj, callbackfn, 1); - return result1 && result2 && accessed; - } -runTestCase(testcase); + +assert(result1, 'result1 !== true'); +assert(result2, 'result2 !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js index 0ec567ef89..9d65313597 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-17 description: > Array.prototype.reduce - 'accumulator' used for current iteration is the result of previous iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var accessed = false; var preIteration = 1; @@ -24,6 +21,6 @@ function testcase() { } [11, 12, 13].reduce(callbackfn, 1); - return result && accessed; - } -runTestCase(testcase); + +assert(result, 'result !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js index 01ae0dfd2d..a3f9f8fe7b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-18.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - value of 'accumulator' used for first iteration is the value of 'initialValue' when it is present on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 0) { @@ -22,6 +19,5 @@ function testcase() { var obj = { 0: 11, 1: 9, length: 2 }; Array.prototype.reduce.call(obj, callbackfn, 1); - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js index 52aaa89ea2..766779d1fc 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - value of 'accumulator' used for first iteration is the value of least index property which is not undefined when 'initialValue' is not present on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var called = 0; var result = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -22,6 +19,6 @@ function testcase() { } [11, 9].reduce(callbackfn); - return result && called === 1; - } -runTestCase(testcase); + +assert(result, 'result !== true'); +assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js index 7aa907f389..15ad8ace1d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-2 description: > Array.prototype.reduce - callbackfn called with correct parameters (initialvalue passed) -includes: [runTestCase.js] ---*/ -function testcase() { - var bParCorrect = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -24,7 +21,5 @@ function testcase() { var arr = [0,1,true,null,new Object(),"five"]; var initialValue = 5.5; - if( arr.reduce(callbackfn,initialValue) === "five") - return true; - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn,initialValue), "five", 'arr.reduce(callbackfn,initialValue)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js index 1af81d84d0..27e59f8030 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-20.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-20 description: Array.prototype.reduce - undefined can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -17,6 +14,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, undefined) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, undefined), true, 'Array.prototype.reduce.call(obj, callbackfn, undefined)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js index 98bcb4acd9..8e061807bd 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-21.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-21 description: Array.prototype.reduce - null can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -17,6 +14,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, null) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, null), true, 'Array.prototype.reduce.call(obj, callbackfn, null)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js index 8eff43af54..17528b9bb5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-22 description: > Array.prototype.reduce - boolean primitive can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, false) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, false), true, 'Array.prototype.reduce.call(obj, callbackfn, false)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js index c06bc3aca5..9ed6701d1f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-23.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-23 description: > Array.prototype.reduce - number primitive can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, 12) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 12), true, 'Array.prototype.reduce.call(obj, callbackfn, 12)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js index 3ca3a438f2..d4068840c2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-24.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-24 description: > Array.prototype.reduce - string primitive can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, "hello_") === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, "hello_"), true, 'Array.prototype.reduce.call(obj, callbackfn, "hello_")'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js index 35aa572230..34c73fb085 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-25.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-25 description: Array.prototype.reduce - Function object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objFunction = function () { }; var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objFunction) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objFunction), true, 'Array.prototype.reduce.call(obj, callbackfn, objFunction)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js index 409cae6225..326e7a081a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-26.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-26 description: Array.prototype.reduce - Array object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objArray = new Array(10); var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objArray) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objArray), true, 'Array.prototype.reduce.call(obj, callbackfn, objArray)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js index 7bd5cec231..727c121855 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-27.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-27 description: Array.prototype.reduce - String object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objString = new String(); var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objString) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objString), true, 'Array.prototype.reduce.call(obj, callbackfn, objString)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js index 230308bf63..03006716d1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-28.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-28 description: Array.prototype.reduce - Boolean object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objBoolean = new Boolean(); var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objBoolean) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objBoolean), true, 'Array.prototype.reduce.call(obj, callbackfn, objBoolean)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js index cff38a8dba..39f1637561 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-29.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-29 description: Array.prototype.reduce - Number object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objNumber = new Number(); var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objNumber) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objNumber), true, 'Array.prototype.reduce.call(obj, callbackfn, objNumber)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js index 239322be0f..3074cd1e60 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-3 description: Array.prototype.reduce - callbackfn takes 4 arguments -includes: [runTestCase.js] ---*/ -function testcase() { - var bCalled = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { return false; } var arr = [0,1,2,3,4,5,6,7,8,9]; - if(arr.reduce(callbackfn,true) === true && bCalled === true) - return true; - } -runTestCase(testcase); + +assert.sameValue(arr.reduce(callbackfn,true), true, 'arr.reduce(callbackfn,true)'); +assert.sameValue(bCalled, true, 'bCalled'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js index 383aa57168..d810b428db 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-30.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-30 description: Array.prototype.reduce - the Math object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -17,6 +14,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, Math) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, Math), true, 'Array.prototype.reduce.call(obj, callbackfn, Math)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js index 9f7904ecfd..c6cd280b30 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-31.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-31 description: Array.prototype.reduce - Date object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objDate = new Date(); var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objDate) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objDate), true, 'Array.prototype.reduce.call(obj, callbackfn, objDate)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js index 025e0419be..adb6a57ab3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-32.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-32 description: Array.prototype.reduce - RegExp object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objRegExp = new RegExp(); var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objRegExp) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objRegExp), true, 'Array.prototype.reduce.call(obj, callbackfn, objRegExp)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js index 0c973e9200..bc7dc899d9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-33.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-33 description: Array.prototype.reduce - the JSON can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -17,6 +14,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, JSON) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, JSON), true, 'Array.prototype.reduce.call(obj, callbackfn, JSON)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js index 1e81b884f0..9a9c1ea528 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-34.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-9-c-ii-34 description: Array.prototype.reduce - Error object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var objError = new RangeError(); var accessed = false; @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, objError) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, objError), true, 'Array.prototype.reduce.call(obj, callbackfn, objError)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js index 00dac48c30..dbd0e61063 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-35.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-35 description: > Array.prototype.reduce - the Arguments object can be used as accumulator -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var arg; @@ -25,6 +22,5 @@ function testcase() { arg = arguments; }(10, 11, 12, 13)); - return Array.prototype.reduce.call(obj, callbackfn, arg) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, arg), true, 'Array.prototype.reduce.call(obj, callbackfn, arg)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js index e49546d60d..b2a7881870 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-37.js @@ -6,13 +6,9 @@ es5id: 15.4.4.21-9-c-ii-37 description: > Array.prototype.reduce - the global object can be used as accumulator -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; @@ -21,6 +17,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; - return Array.prototype.reduce.call(obj, callbackfn, fnGlobalObject()) === true && accessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, fnGlobalObject()), true, 'Array.prototype.reduce.call(obj, callbackfn, fnGlobalObject())'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js index 8fc526b305..468d72a27e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4-s.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce - undefined passed as thisValue to strict callbackfn flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var innerThisCorrect = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,6 +17,5 @@ function testcase() { return true; } [0].reduce(callbackfn,true); - return innerThisCorrect; - } -runTestCase(testcase); + +assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js index e8a1fd2c08..a3da080eb9 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-4 description: > Array.prototype.reduce - k values are passed in acending numeric order on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2]; var lastIdx = 0; var result = true; @@ -26,6 +23,6 @@ function testcase() { } arr.reduce(callbackfn, 11); - return result && accessed; - } -runTestCase(testcase); + +assert(result, 'result !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js index ebdb2a0133..d0efec527b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-5 description: > Array.prototype.reduce - k values are accessed during each iteration and not prior to starting the loop on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var kIndex = []; var called = 0; @@ -32,6 +29,5 @@ function testcase() { [11, 12, 13, 14].reduce(callbackfn, 1); - return result && called === 4; - } -runTestCase(testcase); +assert(result, 'result !== true'); +assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js index cb50d526c8..1c3956cca4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-ii-8 description: > Array.prototype.reduce - element changed by callbackfn on previous iterations is observed -includes: [runTestCase.js] ---*/ -function testcase() { - var result = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 0) { @@ -25,6 +22,5 @@ function testcase() { var obj = { 0: 11, 1: 12, length: 2 }; Array.prototype.reduce.call(obj, callbackfn, 1); - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js index 84ad5fcc2a..58824ccf57 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-ii-9.js @@ -6,17 +6,13 @@ es5id: 15.4.4.21-9-c-ii-9 description: > Array.prototype.reduce - callbackfn is called with 0 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - var called = 0; function callbackfn() { called++; } [11, 12].reduce(callbackfn, 1); - return 2 === called; - } -runTestCase(testcase); + +assert.sameValue(called, 2, 'called'); -- GitLab