From e2e4fa4c93d8c77bcaecff615cc1ea264e7e2c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:17:56 +0200 Subject: [PATCH] Replace runTestCase with assert helpers [test/built-ins/Array/prototype/filter] --- .../Array/prototype/filter/15.4.4.20-0-1.js | 9 ++------- .../Array/prototype/filter/15.4.4.20-0-2.js | 8 +------- .../Array/prototype/filter/15.4.4.20-1-11.js | 7 +------ .../Array/prototype/filter/15.4.4.20-1-12.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-1-14.js | 7 +------ .../Array/prototype/filter/15.4.4.20-1-15.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-1-4.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-1-6.js | 9 +++------ .../Array/prototype/filter/15.4.4.20-1-7.js | 7 +------ .../Array/prototype/filter/15.4.4.20-1-8.js | 6 +----- .../Array/prototype/filter/15.4.4.20-1-9.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-10-1.js | 18 +++++------------- .../Array/prototype/filter/15.4.4.20-10-2.js | 16 ++++------------ .../Array/prototype/filter/15.4.4.20-10-3.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-10-4.js | 10 +--------- .../Array/prototype/filter/15.4.4.20-2-1.js | 7 +------ .../Array/prototype/filter/15.4.4.20-2-10.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-11.js | 9 +++------ .../Array/prototype/filter/15.4.4.20-2-13.js | 9 +++------ .../Array/prototype/filter/15.4.4.20-2-14.js | 9 +++------ .../Array/prototype/filter/15.4.4.20-2-17.js | 7 +------ .../Array/prototype/filter/15.4.4.20-2-18.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-19.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-2.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-3.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-5.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-6.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-7.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-8.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-2-9.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-1.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-10.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-11.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-12.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-13.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-14.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-15.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-16.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-17.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-18.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-19.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-2.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-20.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-21.js | 10 ++++------ .../Array/prototype/filter/15.4.4.20-3-23.js | 10 ++++------ .../Array/prototype/filter/15.4.4.20-3-24.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-25.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-3.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-4.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-5.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-6.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-7.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-3-9.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-4-12.js | 9 +++------ .../Array/prototype/filter/15.4.4.20-5-1-s.js | 7 ++----- .../Array/prototype/filter/15.4.4.20-5-10.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-11.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-12.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-13.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-14.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-15.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-16.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-17.js | 7 ++----- .../Array/prototype/filter/15.4.4.20-5-18.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-19.js | 9 +++------ .../Array/prototype/filter/15.4.4.20-5-2.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-21.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-5-22.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-23.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-24.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-27.js | 7 +------ .../Array/prototype/filter/15.4.4.20-5-28.js | 7 +------ .../Array/prototype/filter/15.4.4.20-5-29.js | 7 +------ .../Array/prototype/filter/15.4.4.20-5-3.js | 7 +------ .../Array/prototype/filter/15.4.4.20-5-30.js | 7 ++----- .../Array/prototype/filter/15.4.4.20-5-4.js | 7 +------ .../Array/prototype/filter/15.4.4.20-5-5.js | 7 +------ .../Array/prototype/filter/15.4.4.20-5-6.js | 7 +------ .../Array/prototype/filter/15.4.4.20-5-7.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-5-9.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-6-1.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-6-2.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-6-3.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-6-4.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-6-5.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-6-6.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-6-7.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-6-8.js | 11 +++-------- .../Array/prototype/filter/15.4.4.20-9-1.js | 7 +------ .../Array/prototype/filter/15.4.4.20-9-2.js | 12 ++++-------- .../Array/prototype/filter/15.4.4.20-9-4.js | 10 ++-------- .../Array/prototype/filter/15.4.4.20-9-5.js | 10 ++-------- .../Array/prototype/filter/15.4.4.20-9-7.js | 8 +++----- .../Array/prototype/filter/15.4.4.20-9-8.js | 9 +++------ .../Array/prototype/filter/15.4.4.20-9-9.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-9-b-1.js | 10 +++------- .../Array/prototype/filter/15.4.4.20-9-b-14.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-9-b-16.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-9-b-2.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-9-b-3.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-9-b-4.js | 8 ++------ .../Array/prototype/filter/15.4.4.20-9-b-5.js | 7 ++----- .../Array/prototype/filter/15.4.4.20-9-b-8.js | 7 ++----- .../Array/prototype/filter/15.4.4.20-9-b-9.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-1.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-10.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-11.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-13.js | 7 ++----- .../prototype/filter/15.4.4.20-9-c-i-15.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-17.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-18.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-2.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-21.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-25.js | 7 ++----- .../prototype/filter/15.4.4.20-9-c-i-26.js | 10 +++------- .../prototype/filter/15.4.4.20-9-c-i-27.js | 11 ++++------- .../prototype/filter/15.4.4.20-9-c-i-28.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-29.js | 7 ++----- .../prototype/filter/15.4.4.20-9-c-i-3.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-5.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-7.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-i-9.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-ii-1.js | 10 +++------- .../prototype/filter/15.4.4.20-9-c-ii-10.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-11.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-12.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-13.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-16.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-17.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-18.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-19.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-2.js | 10 +++------- .../prototype/filter/15.4.4.20-9-c-ii-20.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-21.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-ii-22.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-ii-23.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-4.js | 7 +------ .../prototype/filter/15.4.4.20-9-c-ii-5.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-6.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-8.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-ii-9.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-iii-1-1.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-iii-1-3.js | 7 +------ .../prototype/filter/15.4.4.20-9-c-iii-1-5.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-iii-1-6.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-iii-10.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-11.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-12.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-13.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-14.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-15.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-16.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-17.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-18.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-19.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-2.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-20.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-21.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-22.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-23.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-24.js | 8 ++------ .../prototype/filter/15.4.4.20-9-c-iii-25.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-26.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-28.js | 12 ++++-------- .../prototype/filter/15.4.4.20-9-c-iii-29.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-3.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-30.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-4.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-5.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-6.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-7.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-8.js | 9 +++------ .../prototype/filter/15.4.4.20-9-c-iii-9.js | 9 +++------ 173 files changed, 394 insertions(+), 1079 deletions(-) diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js index 810ab7bf6b..c507b89db2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.20-0-1 description: Array.prototype.filter must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Array.prototype.filter; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js index 1838bb94b8..e5d615e58f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.4.4.20-0-2 description: Array.prototype.filter.length must be 1 -includes: [runTestCase.js] ---*/ -function testcase() { - if (Array.prototype.filter.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.filter.length, 1, 'Array.prototype.filter.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js index 58d4c06d93..95809f57ae 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-11.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-1-11 description: Array.prototype.filter applied to Date object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof Date; } @@ -19,6 +16,4 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === 1; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js index 23f615cd42..f460711cc4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-12.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-1-12 description: Array.prototype.filter applied to RegExp object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof RegExp; } @@ -18,6 +15,5 @@ function testcase() { obj[1] = true; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === true; - } -runTestCase(testcase); + +assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js index 79e505554f..96dd3b7a91 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-14.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-1-14 description: Array.prototype.filter applied to Error object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof Error; } @@ -19,6 +16,4 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === 1; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js index 09cf3cb84a..50393de993 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-15.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-1-15 description: Array.prototype.filter applied to the Arguments object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return '[object Arguments]' === Object.prototype.toString.call(obj); } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === "a" && newArr[1] === "b"; - } -runTestCase(testcase); +assert.sameValue(newArr[0], "a", 'newArr[0]'); +assert.sameValue(newArr[1], "b", 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js index acbfe8cef2..f4d747e569 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-4.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-1-4 description: Array.prototype.filter applied to Boolean Object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof Boolean; } @@ -20,6 +17,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === 11 && newArr[1] === 12; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js index 0031650238..1f3c284047 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-6.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-1-6 description: Array.prototype.filter applied to Number object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof Number; } @@ -19,6 +16,6 @@ function testcase() { obj[1] = 12; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === 11 && newArr[1] === 12; - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js index 36bf5c54a5..1389ccaca9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-7.js @@ -4,17 +4,12 @@ /*--- es5id: 15.4.4.20-1-7 description: Array.prototype.filter applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof String; } var newArr = Array.prototype.filter.call("abc", callbackfn); - return newArr[0] === "a"; - } -runTestCase(testcase); +assert.sameValue(newArr[0], "a", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js index e7a928805e..5f659fadd6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-8.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.20-1-8 description: Array.prototype.filter applied to String object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof String; } @@ -15,6 +13,4 @@ function testcase() { var obj = new String("abc"); var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === "a"; - } -runTestCase(testcase); +assert.sameValue(newArr[0], "a", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js index 0152e7a756..ec8777ce6f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-9.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-1-9 description: Array.prototype.filter applied to Function object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof Function; } @@ -21,6 +18,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === 11 && newArr[1] === 9; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert.sameValue(newArr[1], 9, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js index 9bb86b4e42..b446af28b5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-1.js @@ -6,25 +6,17 @@ es5id: 15.4.4.20-10-1 description: > Array.prototype.filter doesn't mutate the Array on which it is called on -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } var srcArr = [1,2,3,4,5]; srcArr.filter(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/filter/15.4.4.20-10-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js index 5755630417..63125b8071 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-10-2 description: > Array.prototype.filter returns new Array with length equal to number of true returned by callbackfn -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if(val % 2) @@ -20,13 +17,8 @@ function testcase() { } var srcArr = [1,2,3,4,5]; var resArr = srcArr.filter(callbackfn); - if(resArr.length === 3 && - resArr[0] === 1 && - resArr[1] === 3 && - resArr[2] === 5) - { - return true; - } - } -runTestCase(testcase); +assert.sameValue(resArr.length, 3, 'resArr.length'); +assert.sameValue(resArr[0], 1, 'resArr[0]'); +assert.sameValue(resArr[1], 3, 'resArr[1]'); +assert.sameValue(resArr[2], 5, 'resArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js index 0efd73fb48..e5fa29fd5c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-3.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.20-10-3 description: Array.prototype.filter - subclassed array when length is reduced -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -16,9 +14,6 @@ function testcase() { function cb(){return true;} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 1) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 1, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js index 91f476aa60..cbfcb3a90a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-10-4.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-10-4 description: Array.prototype.filter doesn't visit expandos -includes: [runTestCase.js] ---*/ -function testcase() { - var callCnt = 0; function callbackfn(val, idx, obj) { @@ -19,10 +16,5 @@ function testcase() { srcArr[true] = 11; var resArr = srcArr.filter(callbackfn); - if(callCnt == 5) - { - return true; - } - } -runTestCase(testcase); +assert.sameValue(callCnt, 5, 'callCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js index 1d7acf36cd..8c448e47b7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-1 description: > Array.prototype.filter applied to Array-like object, 'length' is own data property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -24,6 +21,4 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js index e18c2500cc..982e0c5463 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-10 description: > Array.prototype.filter applied to Array-like object, 'length' is inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -33,6 +30,5 @@ function testcase() { child[2] = 9; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js index 7ef5dbdbaa..95124b39d4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-11 description: > Array.prototype.filter applied to Array-like object, 'length' is own accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -27,6 +24,6 @@ function testcase() { }); var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js index 55330c69e1..826764cb07 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-13 description: > Array.prototype.filter applied to the Array-like object that 'length' is inherited accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -31,6 +28,6 @@ function testcase() { child[1] = 12; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js index 9c913c40c1..5beb53def1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-14 description: > Array.prototype.filter applied to the Array-like object that 'length property doesn't exist -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -20,6 +17,6 @@ function testcase() { var obj = { 0: 11, 1: 12 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js index c443891e06..8c10fe4b61 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-17 description: > Array.prototype.filter applied to the Arguments object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -20,6 +17,4 @@ function testcase() { return newArr.length === 2; }; - return func(12, 11); - } -runTestCase(testcase); +assert(func(12, 11), 'func(12, 11) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js index 983ac7aabf..88ecbbd669 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-18 description: > Array.prototype.filter applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 3; } @@ -18,6 +15,5 @@ function testcase() { var str = new String("012"); var newArr = Array.prototype.filter.call(str, callbackfn); - return newArr.length === 3; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 3, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js index 9336f2428b..9a69d1a35e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-19 description: > Array.prototype.filter applied to Function object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -23,6 +20,5 @@ function testcase() { fun[2] = 9; var newArr = Array.prototype.filter.call(fun, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js index e1cf9585d0..e2132438d3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-2.js @@ -4,16 +4,12 @@ /*--- es5id: 15.4.4.20-2-2 description: Array.prototype.filter - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } var newArr = [12, 11].filter(callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js index 904e93a3ea..4a545de617 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-3 description: > Array.prototype.filter applied to Array-like object, 'length' is an own data property that overrides an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -27,6 +24,5 @@ function testcase() { child[2] = 9; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js index 8e37a011b9..ce4a96ce76 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-5 description: > Array.prototype.filter to Array-like object, 'length' is an own data property that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -37,6 +34,5 @@ function testcase() { child[2] = 9; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js index eebdda9a95..4d8fc87d2c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-6 description: > Array.prototype.filter applied to Array-like object, 'length' is an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -26,6 +23,5 @@ function testcase() { child[2] = 9; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js index 10a595622f..edcdc2b162 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-7 description: > Array.prototype.filter applied to Array-like object, 'length' is an own accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -29,6 +26,5 @@ function testcase() { obj[2] = 9; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js index 2616fccc67..6d1cc06aa7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-2-8 description: > Array.prototype.filter applied to Array-like object, 'length' is own accessor property that overrides an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -34,6 +31,5 @@ function testcase() { child[2] = 9; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js index c31c4e98e8..42d350ef7f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-9.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter applied to Array-like object, 'length' is an own accessor property that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } @@ -42,6 +39,5 @@ function testcase() { child[2] = 9; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 2; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js index af0d6361c4..97cfad3de4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-1.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-3-1 description: Array.prototype.filter - value of 'length' is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 0, 1: 1, length: undefined }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js index d97c89b72c..f911fd837e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-10 description: > Array.prototype.filter - value of 'length' is a number (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -21,6 +18,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js index f2617dd57a..1fa0f170e4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-11 description: > Array.prototype.filter - 'length' is a string containing a positive number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js index 9dc662ad13..170e54b78b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-12 description: > Array.prototype.filter - 'length' is a string containing a negative number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && newArr[0] === undefined; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js index f2074a4801..d090785638 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-13 description: > Array.prototype.filter - 'length' is a string containing a decimal number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js index 0e1ffe14e2..ec980eabf8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-14.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-3-14 description: Array.prototype.filter - 'length' is a string containing -Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed2 = false; function callbackfn2(val, idx, obj) { @@ -20,6 +17,5 @@ function testcase() { var newArr2 = Array.prototype.filter.call(obj2, callbackfn2); - return !accessed2 && newArr2.length === 0; - } -runTestCase(testcase); +assert.sameValue(accessed2, false, 'accessed2'); +assert.sameValue(newArr2.length, 0, 'newArr2.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js index 064d8d90b4..68e5d56d1a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-15 description: > Array.prototype.filter - 'length' is a string containing an exponential number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js index 31df0b846a..2b2af9bb0f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-16 description: > Array.prototype.filter - 'length' is a string containing a hex number -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js index 50effddbd3..1a3abfd1fb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-17 description: > Array.prototype.filter - 'length' is a string containing a number with leading zeros -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js index 4ccc2893a2..e559d326a0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-18 description: > Array.prototype.filter - value of 'length' is a string that can't convert to a number -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -21,6 +18,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return !accessed && newArr.length === 0; - } -runTestCase(testcase); +assert.sameValue(accessed, false, 'accessed'); +assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js index bc8e3f98b0..303a1fe418 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-19 description: > Array.prototype.filter - value of 'length' is an Object which has an own toString method. -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -27,6 +24,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js index b79453918b..9a6486f275 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-2 description: > Array.prototype.filter applied on an Array-like object if 'length' is 1 (length overridden to true(type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 11, 1: 9, length: true }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js index aa45c30736..d27da75113 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-20 description: > Array.prototype.filter - value of 'length' is an Object which has an own valueOf method. -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -27,6 +24,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js index 81b5525e4f..7f6eefef3e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-21.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - '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 firstStepOccured = false; var secondStepOccured = false; @@ -36,6 +33,7 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11 && firstStepOccured && secondStepOccured; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(firstStepOccured, 'firstStepOccured !== true'); +assert(secondStepOccured, 'secondStepOccured !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js index c8ba73fb8b..6353da8a25 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-23.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-23 description: > Array.prototype.filter uses inherited valueOf method when 'length' is an object with an own toString and inherited valueOf methods -includes: [runTestCase.js] ---*/ -function testcase() { - var valueOfAccessed = false; var toStringAccessed = false; @@ -43,6 +40,7 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11 && valueOfAccessed && !toStringAccessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(toStringAccessed, false, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js index 11793aa4bf..b15dc3f08d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-24.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-24 description: > Array.prototype.filter - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -23,6 +20,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js index 13e504aba8..5228bab7ab 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-25.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-25 description: > Array.prototype.filter - value of 'length' is a negative non-integer -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -23,6 +20,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && newArr[0] === undefined; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js index 915fe8de4e..4b0cdb4471 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-3-3 description: Array.prototype.filter - value of 'length' is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 11, length: 0 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js index b3b5b6ccc1..0cdde8d820 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-4 description: > Array.prototype.filter - value of 'length' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -20,6 +17,5 @@ function testcase() { var obj = { 0: 11, length: +0 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js index 6879103459..2937724c9e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-5 description: > Array.prototype.filter - value of 'length' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -20,6 +17,5 @@ function testcase() { var obj = { 0: 11, length: -0 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js index 03d93792a2..9978de4fee 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-6 description: > Array.prototype.filter - value of 'length' is a number (value is positive) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js index 1d33c73244..4613427724 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-7 description: > Array.prototype.filter - value of 'length' is a number (value is negative) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -18,6 +15,5 @@ function testcase() { var obj = { 1: 11, 2: 9, length: -4294967294 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && newArr[0] === undefined; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js index 776f98ecd6..65f307b33f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-3-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-3-9 description: > Array.prototype.filter - value of 'length' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -21,6 +18,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js index 9bf8f06009..1549ee7852 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-12.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-4-12 description: Array.prototype.filter - 'callbackfn' is a function -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 1) { return val === 9; @@ -17,6 +14,6 @@ function testcase() { } var newArr = [11, 9].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 9; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js index ebf975dc13..ea6126f466 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1-s.js @@ -5,10 +5,8 @@ es5id: 15.4.4.20-5-1-s description: Array.prototype.filter - thisArg not passed to strict callbackfn flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var innerThisCorrect = false; function callbackfn(val, idx, obj) { @@ -18,6 +16,5 @@ function testcase() { } [1].filter(callbackfn); - return innerThisCorrect; - } -runTestCase(testcase); + +assert(innerThisCorrect, 'innerThisCorrect !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js index cf8358a92e..762c8bbce9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-10.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-10 description: Array.prototype.filter - Array Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objArray = new Array(10); @@ -20,6 +17,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objArray); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js index 9f1000c747..9e75e1eef4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-11.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-11 description: Array.prototype.filter - String Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objString = new String(); @@ -19,6 +16,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objString); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js index 3021093d56..77ff80420c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-12.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-12 description: Array.prototype.filter - Boolean Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objBoolean = new Boolean(); @@ -19,6 +16,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objBoolean); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js index fef957b0ce..393228801b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-13.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-13 description: Array.prototype.filter - Number Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objNumber = new Number(); @@ -19,6 +16,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objNumber); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js index 2809cb65c2..e36f9ad9fb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-14.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-14 description: Array.prototype.filter - the Math object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,6 +15,5 @@ function testcase() { var newArr = [11].filter(callbackfn, Math); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js index f8d1923c6b..07fcb1612f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-15.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-15 description: Array.prototype.filter - Date Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objDate = new Date(); @@ -20,6 +17,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objDate); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js index 86c8787312..67201a996f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-16.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-16 description: Array.prototype.filter - RegExp Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objRegExp = new RegExp(); @@ -20,6 +17,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objRegExp); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js index 34e1641e02..b7ac72b671 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-17.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.20-5-17 description: Array.prototype.filter - the JSON object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { @@ -17,6 +15,5 @@ function testcase() { var newArr = [11].filter(callbackfn, JSON); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js index de325a3394..5a59fb9f6f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-18.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-18 description: Array.prototype.filter - Error Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objError = new RangeError(); @@ -19,6 +16,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objError); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js index 00ad7cfbbd..f57406d32d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-5-19 description: > Array.prototype.filter - the Arguments object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var arg; @@ -24,6 +21,6 @@ function testcase() { }(1, 2, 3)); var newArr = [11].filter(callbackfn, arg); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js index 5a9c1f146b..02e553eb92 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-2.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.20-5-2 description: Array.prototype.filter - thisArg is Object -includes: [runTestCase.js] ---*/ -function testcase() { var res = false; var o = new Object(); o.res = true; @@ -18,7 +16,5 @@ function testcase() { var srcArr = [1]; var resArr = srcArr.filter(callbackfn,o); - if( resArr.length === 1) - return true; - } -runTestCase(testcase); + +assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js index f2933a462b..a181811efe 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-21.js @@ -4,13 +4,9 @@ /*--- es5id: 15.4.4.20-5-21 description: Array.prototype.filter - the global object can be used as thisArg -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -20,6 +16,5 @@ function testcase() { var newArr = [11].filter(callbackfn, fnGlobalObject()); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js index 934188ecad..061b7dacf8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-22.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-22 description: Array.prototype.filter - boolean primitive can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,6 +15,5 @@ function testcase() { var newArr = [11].filter(callbackfn, false); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js index 85137c0026..e7b7325950 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-23.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-23 description: Array.prototype.filter - number primitive can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,6 +15,5 @@ function testcase() { var newArr = [11].filter(callbackfn, 101); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js index c936139b10..d52a32e5b9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-24.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-24 description: Array.prototype.filter - string primitive can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,6 +15,5 @@ function testcase() { var newArr = [11].filter(callbackfn, "abc"); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js index e541ca09c0..4a4c5e3fb5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-27.js @@ -6,13 +6,8 @@ es5id: 15.4.4.20-5-27 description: > Array.prototype.filter - Array.isArray(arg) returns true when arg is the returned array -includes: [runTestCase.js] ---*/ -function testcase() { - var newArr = [11].filter(function () { }); - return Array.isArray(newArr); - } -runTestCase(testcase); +assert(Array.isArray(newArr), 'Array.isArray(newArr) !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js index 78620d3e6e..0dc9327221 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-28.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.20-5-28 description: Array.prototype.filter - the returned array is instanceof Array -includes: [runTestCase.js] ---*/ -function testcase() { - var newArr = [11].filter(function () { }); - return newArr instanceof Array; - } -runTestCase(testcase); +assert(newArr instanceof Array, 'newArr instanceof Array !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js index 53bb28f98e..5d6fd637f5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-29.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.20-5-29 description: Array.prototype.filter - returns an array whose length is 0 -includes: [runTestCase.js] ---*/ -function testcase() { - var newArr = [11].filter(function () { }); - return newArr.length === 0; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js index 8da7ffcc43..2c1d815f02 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-3.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.20-5-3 description: Array.prototype.filter - thisArg is Array -includes: [runTestCase.js] ---*/ -function testcase() { var res = false; var a = new Array(); a.res = true; @@ -18,8 +16,5 @@ function testcase() { var srcArr = [1]; var resArr = srcArr.filter(callbackfn,a); - if( resArr.length === 1) - return true; - } -runTestCase(testcase); +assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js index e61f0a3673..8f63e7058a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-30.js @@ -5,10 +5,8 @@ es5id: 15.4.4.20-5-30 description: Array.prototype.filter - thisArg not passed flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function innerObj() { this._15_4_4_20_5_30 = true; var _15_4_4_20_5_30 = false; @@ -20,6 +18,5 @@ function testcase() { var resArr = srcArr.filter(callbackfn); this.retVal = resArr.length === 0; } - return new innerObj().retVal; - } -runTestCase(testcase); + +assert(new innerObj().retVal, 'new innerObj().retVal !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js index 4766544600..5a277cdb23 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-4.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-5-4 description: > Array.prototype.filter - thisArg is object from object template(prototype) -includes: [runTestCase.js] ---*/ -function testcase() { var res = false; function callbackfn(val, idx, obj) { @@ -22,8 +20,5 @@ function testcase() { var srcArr = [1]; var resArr = srcArr.filter(callbackfn,f); - if( resArr.length === 1) - return true; - } -runTestCase(testcase); +assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js index 015f506d7c..dbcd622312 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-5.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.20-5-5 description: Array.prototype.filter - thisArg is object from object template -includes: [runTestCase.js] ---*/ -function testcase() { var res = false; function callbackfn(val, idx, obj) { @@ -20,8 +18,5 @@ function testcase() { var srcArr = [1]; var resArr = srcArr.filter(callbackfn,f); - if( resArr.length === 1) - return true; - } -runTestCase(testcase); +assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js index 779deaf480..1eb2df4c2f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-6.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.20-5-6 description: Array.prototype.filter - thisArg is function -includes: [runTestCase.js] ---*/ -function testcase() { var res = false; function callbackfn(val, idx, obj) { @@ -19,8 +17,5 @@ function testcase() { var srcArr = [1]; var resArr = srcArr.filter(callbackfn,foo); - if( resArr.length === 1) - return true; - } -runTestCase(testcase); +assert.sameValue(resArr.length, 1, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js index eb53a8cc13..a6afd0c203 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-7.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-7 description: Array.prototype.filter - built-in functions can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,6 +15,5 @@ function testcase() { var newArr = [11].filter(callbackfn, eval); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js index d0b5799a76..3fdc374e75 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-9.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-5-9 description: Array.prototype.filter - Function Object can be used as thisArg -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var objFunction = function () { }; @@ -19,6 +16,5 @@ function testcase() { var newArr = [11].filter(callbackfn, objFunction); - return newArr[0] === 11 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js index c39bccca90..853db3f7a6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-1.js @@ -6,15 +6,10 @@ es5id: 15.4.4.20-6-1 description: > Array.prototype.filter returns an empty array if 'length' is 0 (empty array) -includes: [runTestCase.js] ---*/ -function testcase() { function cb(){} var a = [].filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js index 418c5fa2cc..df38841a66 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-2.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-6-2 description: > Array.prototype.filter returns an empty array if 'length' is 0 (subclassed Array, length overridden to null (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -18,9 +16,6 @@ function testcase() { function cb(){} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js index 31b450472f..093e48da06 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-3.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-6-3 description: > Array.prototype.filter returns an empty array if 'length' is 0 (subclassed Array, length overridden to false (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -18,9 +16,6 @@ function testcase() { function cb(){} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js index d2206a1092..fb2d3a9e61 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-4.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-6-4 description: > Array.prototype.filter returns an empty array if 'length' is 0 (subclassed Array, length overridden to 0 (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -18,9 +16,6 @@ function testcase() { function cb(){} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js index 011bcd8e7a..268fb9211e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-5.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-6-5 description: > Array.prototype.filter returns an empty array if 'length' is 0 (subclassed Array, length overridden to '0' (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -18,9 +16,6 @@ function testcase() { function cb(){} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js index fddd243948..8ec27a1cd1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-6.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-6-6 description: > Array.prototype.filter returns an empty array if 'length' is 0 (subclassed Array, length overridden with obj with valueOf) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -20,9 +18,6 @@ function testcase() { function cb(){} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js index b10787f270..8075b1500c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-7.js @@ -7,10 +7,8 @@ description: > Array.prototype.filter returns an empty array if 'length' is 0 (subclassed Array, length overridden with obj w/o valueOf (toString)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -27,9 +25,6 @@ function testcase() { function cb(){} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js index ac90c170b7..e526241d8e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-6-8.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-6-8 description: > Array.prototype.filter returns an empty array if 'length' is 0 (subclassed Array, length overridden with [] -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -33,9 +31,6 @@ function testcase() { function cb(){} var a = f.filter(cb); - if (Array.isArray(a) && - a.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert(Array.isArray(a), 'Array.isArray(a) !== true'); +assert.sameValue(a.length, 0, 'a.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js index fa09007c7d..0e430bde3f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-1 description: > Array.prototype.filter doesn't consider new elements added to array after it is called -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { srcArr[2] = 3; srcArr[5] = 6; @@ -19,7 +16,5 @@ function testcase() { var srcArr = [1, 2, , 4, 5]; var resArr = srcArr.filter(callbackfn); - return resArr.length === 5; - } -runTestCase(testcase); +assert.sameValue(resArr.length, 5, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js index 75f400bee3..8e60bc4e0d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-2 description: > Array.prototype.filter considers new value of elements in array after it is called -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { srcArr[2] = -1; @@ -23,8 +20,7 @@ function testcase() { var srcArr = [1,2,3,4,5]; var resArr = srcArr.filter(callbackfn); - if(resArr.length === 3 && resArr[0] === 1 && resArr[2] === 4) - return true; - - } -runTestCase(testcase); + +assert.sameValue(resArr.length, 3, 'resArr.length'); +assert.sameValue(resArr[0], 1, 'resArr[0]'); +assert.sameValue(resArr[2], 4, 'resArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js index 8c0290da09..12d72803a8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-4 description: > Array.prototype.filter doesn't visit deleted elements when Array.length is decreased -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { srcArr.length = 2; @@ -19,8 +16,5 @@ function testcase() { var srcArr = [1,2,3,4,6]; var resArr = srcArr.filter(callbackfn); - if(resArr.length === 2 ) - return true; - - } -runTestCase(testcase); + +assert.sameValue(resArr.length, 2, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js index 78318cca81..30c8ddf1f3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-5 description: > Array.prototype.filter doesn't consider newly added elements in sparse array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { srcArr[1000] = 3; @@ -21,8 +18,5 @@ function testcase() { srcArr[1] = 1; srcArr[2] = 2; var resArr = srcArr.filter(callbackfn); - if( resArr.length === 2) - return true; - - } -runTestCase(testcase); + +assert.sameValue(resArr.length, 2, 'resArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js index eb157c05cd..1b356a04d9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-9-7 description: > Array.prototype.filter stops calling callbackfn once the array is deleted during the call -includes: [runTestCase.js] ---*/ -function testcase() { var o = new Object(); o.srcArr = [1, 2, 3, 4, 5]; @@ -22,6 +20,6 @@ function testcase() { } var resArr = o.srcArr.filter(callbackfn); - return resArr.length === 5 && typeof o.srcArr === "undefined"; - } -runTestCase(testcase); + +assert.sameValue(resArr.length, 5, 'resArr.length'); +assert.sameValue(typeof o.srcArr, "undefined", 'typeof o.srcArr'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js index 983acbe1cf..9209283386 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-8.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-9-8 description: Array.prototype.filter - no observable effects occur if len is 0 -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -20,6 +17,6 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return accessed === false && obj.length === 0 && newArr.length === 0; - } -runTestCase(testcase); +assert.sameValue(accessed, false, 'accessed'); +assert.sameValue(obj.length, 0, 'obj.length'); +assert.sameValue(newArr.length, 0, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js index d28ebcfe14..9faa3c3c27 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-9 description: > Array.prototype.filter - modifications to length don't change number of iterations -includes: [runTestCase.js] ---*/ -function testcase() { - var called = 0; function callbackfn(val, idx, obj) { @@ -30,6 +27,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && 2 === called; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js index d90377c627..86b22f227c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-1 description: > Array.prototype.filter - callbackfn not called for indexes never been assigned values -includes: [runTestCase.js] ---*/ -function testcase() { - var callCnt = 0; function callbackfn(val, idx, obj) { @@ -21,7 +18,6 @@ function testcase() { var srcArr = new Array(10); srcArr[1] = undefined; //explicitly assigning a value var resArr = srcArr.filter(callbackfn); - if( resArr.length === 0 && callCnt === 1) - return true; - } -runTestCase(testcase); + +assert.sameValue(resArr.length, 0, 'resArr.length'); +assert.sameValue(callCnt, 1, 'callCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js index b90f5fb899..6e0cb62b47 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-14 description: > Array.prototype.filter - decreasing length of array causes index property not to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -27,6 +24,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[2] === 2; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[2], 2, 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js index 7a5e4926f4..35377f2fb1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-16.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - decreasing length of array does not delete non-configurable properties flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -35,6 +32,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[2] === "unconfigurable"; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[2], "unconfigurable", 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js index a4f4529c83..dfbf641127 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-2 description: > Array.prototype.filter - added properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -27,6 +24,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === "length"; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], "length", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js index b404aaa9e6..80020fa7ef 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-3 description: > Array.prototype.filter - deleted properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -26,6 +23,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] !== 6.99; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.notSameValue(newArr[0], 6.99, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js index 236635a926..eae3e16781 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-4 description: > Array.prototype.filter - properties added into own object after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -32,6 +29,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && newArr[1] === 6.99; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js index bb63b59ad8..bb049f1e05 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-5.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-9-b-5 description: > Array.prototype.filter - properties added into own object after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } @@ -31,6 +29,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[1] === 6.99; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js index 4b23515741..7888ab9c36 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-8.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-9-b-8 description: > Array.prototype.filter - deleting own property causes index property not to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; var obj = { length: 2 }; @@ -35,6 +33,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 0; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 0, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js index 13cc854530..1198c054c7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-9 description: > Array.prototype.filter - deleting own property causes index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -33,6 +30,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === 0; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 0, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js index 802be2dd9f..e0a71dc8d5 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-1 description: > Array.prototype.filter - element to be retrieved is own data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = {}; function callbackfn(val, idx, obj) { return (idx === 5) && (val === kValue); @@ -20,6 +17,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === kValue; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], kValue, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js index 73a95f2c41..6cc5ec419f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-10 description: > Array.prototype.filter - element to be retrieved is own accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 2 && val === 12; } @@ -25,6 +22,5 @@ function testcase() { }); var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === 12; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js index e7ed89eefe..a9ce26971a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-11.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } @@ -32,6 +29,5 @@ function testcase() { }); var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js index da47ff946a..e8dd405e8d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-13.js @@ -7,10 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return idx === 1 && val === 12; } @@ -38,6 +36,5 @@ function testcase() { }); var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 1 && newArr[0] === 12; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js index c149c40593..3244f03dbc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-15 description: > Array.prototype.filter - element to be retrieved is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val === 11 && idx === 1; } @@ -31,6 +28,5 @@ function testcase() { child.length = 20; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js index fcace81def..bbc08a9672 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-17 description: > Array.prototype.filter - element to be retrieved is own accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 1; } @@ -23,6 +20,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js index 1cab9d884a..6e445a0b87 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-18 description: > Array.prototype.filter - element to be retrieved is own accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 0; } @@ -24,6 +21,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js index 061a80055d..dc8ba25f97 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-2 description: > Array.prototype.filter - element to be retrieved is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 11; @@ -19,6 +16,5 @@ function testcase() { var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js index 59a85d009d..5c9af8a2ab 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-21.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-21 description: > Array.prototype.filter - element to be retrieved is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val === undefined && idx === 1; } @@ -28,6 +25,5 @@ function testcase() { child.length = 2; var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js index 1fb0f12826..4ffa430fab 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-25.js @@ -7,10 +7,8 @@ description: > Array.prototype.filter - 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() { function callbackfn(val, idx, obj) { return val === 11 && idx === 0; } @@ -21,6 +19,5 @@ function testcase() { var newArr = func(11); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js index 2f3f84d2a6..c56c14fbaf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-26.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - 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() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 11; @@ -27,7 +24,6 @@ function testcase() { }; var newArr = func(11, 9); - return newArr.length === 2 && newArr[0] === 11 && - newArr[1] === 9; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert.sameValue(newArr[1], 9, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js index 23fe0f2e43..595424887d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-27.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - 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() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 11; @@ -29,7 +26,7 @@ function testcase() { }; var newArr = func(11, 12, 9); - return newArr.length === 3 && newArr[0] === 11 && - newArr[1] === 12 && newArr[2] === 9; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert.sameValue(newArr[1], 12, 'newArr[1]'); +assert.sameValue(newArr[2], 9, 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js index d4e3fee5ca..61d444c947 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-28 description: > Array.prototype.filter - element changed by getter on previous iterations is observed on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var preIterVisible = false; var arr = []; @@ -38,6 +35,5 @@ function testcase() { }); var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === 9; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js index 27611554dd..04ffb5c422 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-29.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-9-c-i-29 description: > Array.prototype.filter - element changed by getter on previous iterations is observed on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val === 9 && idx === 1; } @@ -37,6 +35,5 @@ function testcase() { }); var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 9; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 9, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js index 7b8bdeff11..199d43e394 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-3.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return (idx === 5) && (val === "abc"); } @@ -27,6 +24,5 @@ function testcase() { var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 1 && newArr[0] === "abc"; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], "abc", 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js index f1c644ffbe..9a0c8b197a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-5.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } @@ -38,6 +35,5 @@ function testcase() { var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js index df63165cdd..83dc74ad3d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-7 description: > Array.prototype.filter - element to be retrieved is inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = 'abc'; function callbackfn(val, idx, obj) { @@ -27,6 +24,5 @@ function testcase() { var newArr = Array.prototype.filter.call(child, callbackfn); - return newArr.length === 1 && newArr[0] === kValue; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], kValue, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js index 4eee6faa1d..ff21e3316d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-i-9 description: > Array.prototype.filter - element to be retrieved is own accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return (idx === 0) && (val === 11); } @@ -25,6 +22,6 @@ function testcase() { }); var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js index 5eb9a84ff6..036a703865 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-1.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-9-c-ii-1 description: Array.prototype.filter - callbackfn called with correct parameters -includes: [runTestCase.js] ---*/ -function testcase() { - var bPar = true; var bCalled = false; function callbackfn(val, idx, obj) @@ -22,7 +19,6 @@ function testcase() { srcArr[999999] = -6.6; var resArr = srcArr.filter(callbackfn); - if(bCalled === true && bPar === true) - return true; - } -runTestCase(testcase); + +assert.sameValue(bCalled, true, 'bCalled'); +assert.sameValue(bPar, true, 'bPar'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js index 5e690d3523..467350d87c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-10.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-ii-10 description: > Array.prototype.filter - callbackfn is called with 1 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val) { return val > 10; } var newArr = [12].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 12; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js index 61083d8e41..9db1998b5f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-11.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-ii-11 description: > Array.prototype.filter - callbackfn is called with 2 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx) { return val > 10 && arguments[2][idx] === val; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js index 4ba8ddcd45..e69abc72b6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-12.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-ii-12 description: > Array.prototype.filter - callbackfn is called with 3 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val > 10 && obj[idx] === val; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js index ec47d0ac8c..672af4d861 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-13.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-ii-13 description: > Array.prototype.filter - callbackfn that uses arguments object to get parameter value -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn() { return arguments[2][arguments[1]] === arguments[0]; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js index 6e57df7366..fd8b23eb30 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-16 description: > Array.prototype.filter - 'this' of 'callbackfn' is a Boolean object when T is not an object (T is a boolean) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return this.valueOf() === false; } @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 11, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn, false); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js index 9b69702dc3..6a57b59ff6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-17 description: > Array.prototype.filter -'this' of 'callbackfn' is a Number object when T is not an object (T is a number) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, o) { return 5 === this.valueOf(); } @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 11, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn, 5); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js index 4d2ddff8f4..24bc9dff34 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-18 description: > Array.prototype.filter - 'this' of 'callbackfn' is an String object when T is not an object (T is a string) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return 'hello' === this.valueOf(); } @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 11, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn, "hello"); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js index 7539130fb3..def6f012cf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-19.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-9-c-ii-19 description: Array.prototype.filter - non-indexed properties are not called -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -19,6 +16,5 @@ function testcase() { var obj = { 0: 11, non_index_property: 8, 2: 5, length: 20 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js index 89181aed85..19ca09edee 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-2.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-9-c-ii-2 description: Array.prototype.filter - callbackfn takes 3 arguments -includes: [runTestCase.js] ---*/ -function testcase() { - var parCnt = 3; var bCalled = false function callbackfn(val, idx, obj) @@ -20,7 +17,6 @@ function testcase() { var srcArr = [0,1,2,3,4,5,6,7,8,9]; var resArr = srcArr.filter(callbackfn); - if(bCalled === true && parCnt === 3) - return true; - } -runTestCase(testcase); + +assert.sameValue(bCalled, true, 'bCalled'); +assert.sameValue(parCnt, 3, 'parCnt'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js index f8ddeeecca..efc02456a7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-20 description: > Array.prototype.filter - callbackfn called with correct parameters (thisArg is correct) -includes: [runTestCase.js] ---*/ -function testcase() { - var thisArg = { threshold: 10 }; function callbackfn(val, idx, obj) { @@ -20,6 +17,5 @@ function testcase() { var obj = { 0: 11, length: 1 }; var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js index 8f645d49bf..455a642676 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-21.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-21 description: > Array.prototype.filter - callbackfn called with correct parameters (kValue is correct) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 11; @@ -26,6 +23,6 @@ function testcase() { var obj = { 0: 11, 1: 12, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && newArr[0] === 11 && newArr[1] === 12; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js index 7279c92349..791d1af0d6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-22 description: > Array.prototype.filter - callbackfn called with correct parameters (the index k is correct) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (val === 11) { return idx === 0; @@ -26,6 +23,6 @@ function testcase() { var obj = { 0: 11, 1: 12, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && newArr[0] === 11 && newArr[1] === 12; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); +assert.sameValue(newArr[1], 12, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js index ebd639110d..0a17eff2b6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-23.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-23 description: > Array.prototype.filter - callbackfn called with correct parameters (this object O is correct) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, length: 2 }; function callbackfn(val, idx, o) { @@ -19,6 +16,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js index ec0756d6ce..61a1a3f99d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-4 description: > Array.prototype.filter - k values are passed in ascending numeric order -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2, 3, 4, 5]; var lastIdx = 0; var called = 0; @@ -25,6 +22,4 @@ function testcase() { } var newArr = arr.filter(callbackfn); - return newArr.length === called; - } -runTestCase(testcase); +assert.sameValue(newArr.length, called, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js index e16f74e721..666edc441b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-5 description: > Array.prototype.filter - k values are accessed during each iteration and not prior to starting the loop on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kIndex = []; var called = 0; @@ -31,6 +28,5 @@ function testcase() { } var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); - return newArr.length === 0 && called === 4; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js index 81f717ba36..f31470f623 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-6 description: > Array.prototype.filter - arguments to callbackfn are self consistent -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, length: 1 }; var thisArg = {}; @@ -23,6 +20,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn, thisArg); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js index 3cf88c29fe..1a79ce2eaf 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-ii-8 description: > Array.prototype.filter - element changed by callbackfn on previous iterations is observed -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12, length: 2 }; function callbackfn(val, idx, o) { @@ -22,6 +19,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js index c03e60dadc..82844f7c14 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-ii-9.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-ii-9 description: > Array.prototype.filter - callbackfn is called with 0 formal parameter -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn() { return true; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js index 2844a1112d..621cc22d49 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-1-1 description: > Array.prototype.filter - value of returned array element equals to 'kValue' -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -18,6 +15,5 @@ function testcase() { var obj = { 0: 11, 1: 9, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr[0] === obj[0] && newArr[1] === obj[1]; - } -runTestCase(testcase); +assert.sameValue(newArr[0], obj[0], 'newArr[0]'); +assert.sameValue(newArr[1], obj[1], 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js index 54d6e284ec..c2c65aec8f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-1-3 description: > Array.prototype.filter - value of returned array element can be enumerated -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -28,6 +25,4 @@ function testcase() { } } - return enumerable; - } -runTestCase(testcase); +assert(enumerable, 'enumerable !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js index 1c10d784c5..465f03d93b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-1-5 description: > Array.prototype.filter - values of 'to' are passed in acending numeric order -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2, 3, 4]; var lastToIdx = 0; var called = 0; @@ -25,6 +22,5 @@ function testcase() { } var newArr = arr.filter(callbackfn); - return newArr.length === 5 && called === 5; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 5, 'newArr.length'); +assert.sameValue(called, 5, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js index 7fd9459946..8a748a8bf1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-6.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - values of 'to' are accessed during each iteration when 'selected' is converted to true and not prior to starting the loop -includes: [runTestCase.js] ---*/ -function testcase() { - var toIndex = []; var called = 0; @@ -32,6 +29,5 @@ function testcase() { } var newArr = [11, 12, 13, 14].filter(callbackfn, undefined); - return newArr.length === 4 && called === 4; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 4, 'newArr.length'); +assert.sameValue(called, 4, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js index 6dcb0ba285..3b39bc22e2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-10.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-10 description: > Array.prototype.filter return value of callbackfn is a number (value is negative number) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return -5; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js index 63eaf96070..e6801a0b9b 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-11.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-11 description: > Array.prototype.filter return value of callbackfn is a number (value is Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return Infinity; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js index 7683080c6a..8f08dfd773 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-12.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-12 description: > Array.prototype.filter return value of callbackfn is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return -Infinity; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js index 71e8eb2c0e..30d079816c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-13 description: > Array.prototype.filter return value of callbackfn is a number (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -19,6 +16,6 @@ function testcase() { } var newArr = [11].filter(callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js index e703ae5bbf..8fd768e2db 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-14 description: > Array.prototype.filter return value of callbackfn is an empty string -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -19,6 +16,6 @@ function testcase() { } var newArr = [11].filter(callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js index 9a38dbebdb..756a982250 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-15.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-15 description: > Array.prototype.filter return value of callbackfn is a non-empty string -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return "non-empty string"; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js index ef699515cc..e9af95d1a7 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-16.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-16 description: > Array.prototype.filter return value of callbackfn is a Function object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return function () { }; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js index 078f06d02e..5de45f6b35 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-17.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-17 description: > Array.prototype.filter return value of callbackfn is an Array object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new Array(10); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js index 024ed4f7cc..bf495741f3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-18.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-18 description: > Array.prototype.filter return value of callbackfn is a String object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new String(); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js index 3c43c07ef9..537bc1823e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-19.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-19 description: > Array.prototype.filter return value of callbackfn is a Boolean object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new Boolean(); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js index 49e9d9d80a..36115cb3fc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-2.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-9-c-iii-2 description: Array.prototype.filter - return value of callbackfn is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, o) { @@ -19,6 +16,6 @@ function testcase() { var obj = { 0: 11, length: 1 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js index 4a698dd269..b0a76cc98e 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-20.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-20 description: > Array.prototype.filter - return value of callbackfn is a Number object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new Number(); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js index 36d08b6223..70cdd1d9fb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-21.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-21 description: > Array.prototype.filter - return value of callbackfn is the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return Math; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js index 292a707120..7a1dc81cca 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-22.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-22 description: > Array.prototype.filter - return value of callbackfn is a Date object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new Date(); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js index c69d6c58e2..4cc1be3b34 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-23.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-23 description: > Array.prototype.filter - return value of callbackfn is a RegExp object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new RegExp(); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js index b3d989a9d7..2e9dbb431f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-24.js @@ -6,17 +6,13 @@ es5id: 15.4.4.20-9-c-iii-24 description: > Array.prototype.filter - return value of callbackfn is the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return JSON; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js index 2ee67815c6..6444609dee 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-25.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-25 description: > Array.prototype.filter - return value of callbackfn is an Error object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new EvalError(); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js index ab979d0341..dda54944f9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-26.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-26 description: > Array.prototype.filter - return value of callbackfn is the Arguments object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return arguments; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js index 0777dbe291..4bd224f220 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-28.js @@ -6,18 +6,14 @@ es5id: 15.4.4.20-9-c-iii-28 description: > Array.prototype.filter - return value of callbackfn is the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return fnGlobalObject(); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js index bcbaffe317..616822e1fc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-29 description: > Array.prototype.filter - false prevents element added to output Array -includes: [runTestCase.js] ---*/ -function testcase() { - var called = 0; function callbackfn(val, idx, obj) { @@ -21,7 +18,7 @@ function testcase() { var obj = { 0: 11, 1: 8, length: 20 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] !== 8 && called === 2; - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.notSameValue(newArr[0], 8, 'newArr[0]'); +assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js index 542cda5b04..6487fd9297 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.20-9-c-iii-3 description: Array.prototype.filter - return value of callbackfn is null -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -19,6 +16,6 @@ function testcase() { var obj = { 0: 11, length: 1 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js index acc0c0a2d6..ccdafac4af 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-30.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-30 description: > Array.prototype.filter - return value (new Boolean(false)) of callbackfn is treated as true value -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return new Boolean(false); } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js index d476381fe9..009734858a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-4 description: > Array.prototype.filter - return value of callbackfn is a boolean (value is false) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -21,6 +18,6 @@ function testcase() { var obj = { 0: 11, length: 1 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js index 82317a141c..70b3c651e0 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-5 description: > Array.prototype.filter - return value of callbackfn is a boolean (value is true) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -18,6 +15,6 @@ function testcase() { var obj = { 0: 11, length: 1 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js index 5d4c34ee4c..cf029cb4bb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-6 description: > Array.prototype.filter - return value of callbackfn is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -19,6 +16,6 @@ function testcase() { } var newArr = [11].filter(callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js index 5ff2a75027..2dda2ab49a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-7 description: > Array.prototype.filter - return value of callbackfn is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -19,6 +16,6 @@ function testcase() { } var newArr = [11].filter(callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js index 0f4663f994..23263f9613 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-8 description: > Array.prototype.filter - return value of callbackfn is a nunmber (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -19,6 +16,6 @@ function testcase() { } var newArr = [11].filter(callbackfn); - return newArr.length === 0 && accessed; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js index a756d78414..b9eac52961 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-9.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-c-iii-9 description: > Array.prototype.filter - return value of callbackfn is a number (value is positive number) -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return 5; } var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]');