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 810ab7bf6b37da6b2c905bedf7696bf92fbac4aa..c507b89db206709cb4a05e2d1659ee50f803cfff 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 1838bb94b834e8e23afe99c5fd63e739848b71d7..e5d615e58f571651c47f722cb8aae256b26c3d8a 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 58d4c06d93149dcea34f18fecdab517e43c58d5d..95809f57ae109283ad9c33d7697b4d6c42f80c37 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 23f615cd4268c06635815b8876939fd83be5607d..f460711cc4b2ef67095473955300fe8a1a8beff9 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 79e505554fdda37a4e147644781d8e8532edfdaf..96dd3b7a91405277b36c13aca21a0eb63471aa2f 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 09cf3cb84a3773e585022a4c4c93d585737ca13b..50393de993e1c57ea627356e1fc008213b7146df 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 acbfe8cef26d3bc3b5cb4689a0f34a5b8850c711..f4d747e569c4eb899f72c2cc2aacc490052c4b17 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 0031650238168e03da341520d233b63b4ef99ec5..1f3c284047958ddc5ed9d5326a3a708f7201c344 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 36bf5c54a57276e8cdc6e303767def88ba9ad967..1389ccaca970ec2ecbf162ae0e3f046e46427817 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 e7a928805efb61c76ee06adf0567431a24d09733..5f659fadd675e70479b277dd9d060b726153d137 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 0152e7a756604c29162d1d4a235ed777b0482756..ec8777ce6fcc3af968adfa32e8e9ef2c76d614a4 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 9bb86b4e422dcc40976a05a3206e0aa99bfa39df..b446af28b5d1e7cc6b597b15a27acdec42dc0cea 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 57556304179a9ecc9a86faa0be00a724671903bf..63125b8071eb4300d5adeb4dec3349aead49b70b 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 0efd73fb48be7ad1dfdcb4f01d0bb1b103d8d2d5..e5fa29fd5c9c9ce39bcad35eac9b4fb8eb7bb645 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 91f476aa60544111eace868389b827bcf66f120d..cbfcb3a90ab5abebaaf2980d0c17e88dedd19f89 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 1d7acf36cd4689d3dd6de5177401d55d77ec5db7..8c448e47b7db6fb1bc301b4d50c65d13302fceaf 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 e18c2500ccfcdfd3640c7de683ccdd3c1ce24070..982e0c54635f3faea0c0a3399c9e4870c4e16bb4 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 7ef5dbdbaa1e4654cdd782d756dd7d806b49d6cd..95124b39d4efc6fc0f847c6bc38c76c9c6cc16e3 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 55330c69e18a673bd660761e9633c27e40f28ad0..826764cb07570155b42ca30d7486b3386af38ea2 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 9c913c40c166d45db7650527a892b9daf975662c..5beb53def197b575c9d16c6e9d1274100becde73 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 c443891e06eb8ae4f8afab74c426440b06503d1c..8c10fe4b610d123fb90c40ef749053146fc6ecf8 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 983ac7aabf0177c199911194b4ff10daeefd5acc..88ecbbd6693628c5902c1837a5cff4fabf13d536 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 9336f2428b84c44b4f3c3240b43630a3c34fe4c0..9a69d1a35e8079d67a1d3664d59b72191e749698 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 e1cf9585d0033d85396c98af23228dba29d17c75..e2132438d3fe3cd4eea720fc62939faf568feee4 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 904e93a3ea798c93e8095f6a6c59e757eaf0e218..4a545de6176e35962e6cc35ebd6dc9e6f6d9871b 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 8e37a011b9e37a66bec1764daa24e8417648ef14..ce4a96ce76a7f75232009632a5405c3923a1cef9 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 eebdda9a95211671f839a22dd24b71e7fa6e3b97..4d8fc87d2c348df5fbcda081bf1421c320953c55 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 10a595622fd69388090fe0f30005ad2ca2f8a37f..edcdc2b16246e24e79d675e09cadac8b6a948905 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 2616fccc67a4395492035fed52b229fa2f156db0..6d1cc06aa73003ef4013294ce3bdbd952d62fdca 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 c31c4e98e8daa35da2722e870343d2849c3e5672..42d350ef7faaf468f42c28333a5a6959ffe6675e 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 af0d6361c4f58be1d868aa316629fccd81a85f96..97cfad3de4b49f76c126fd9a240b187c98e327fb 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 d97c89b72cd9a1609d8d4382bd74da23c2b19e8b..f911fd837eb51db5a5ced30652dad98c3e31767e 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 f2617dd57aebad0d6cd22c996d67b37bf74bb5a4..1fa0f170e40d4413d3981a8ecd3410ff52ac0d80 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 9dc662ad1303557e05ac44ad3b1859db34a887ea..170e54b78b588d3cc0b4566809df92e3bfa881dd 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 f2074a48012da7d3073112b405246cf838efb8f9..d0907856387142c0d14cafd675f3fbf0e0c0ff99 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 0e1ffe14e2587092205d3aeb49139459260710f4..ec980eabf896be94d4e4cbfbee8915e81b0f49e8 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 064d8d90b441fa80699c61fb9a5079e3313f6b3a..68e5d56d1ac0a09aaea51da0f9641c257f1d5039 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 31df0b846aa5abd45a6b54261e3ed01e2e29a476..2b2af9bb0fe432f450fe77d9875d27f02860b26c 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 50effddbd35aa37d453953352e7242529ace580a..1a3abfd1fbadf328a479d5f7cf8f5fd927595f2c 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 4ccc2893a25882a1a61026807dce8059db6e6634..e559d326a00cfacade4a79d522acd32310039d8a 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 bc8e3f98b0e6f17467e20d087e53f25da008c133..303a1fe418bb6d8204880b70560aa9ee16b071c0 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 b79453918beb62ea2146e7e3be4ed565283ff5a7..9a6486f275ffb891a03412ef11bff62c06497528 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 aa45c30736d04085d091ce94997c9b82ce05896b..d27da751132b844f8a0257367799907746d3a514 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 81b5525e4f99e971938c835288f3644018e13e25..7f6eefef3e6eebd439c09136bfde7c3b2d4647fb 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 c8ba73fb8b79ac5706f0dcd26927a10342e96931..6353da8a2573346f93ece587e3576a6f1b60e9c0 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 11793aa4bfd0be047cf343359e95952d20d27982..b15dc3f08d9b8af6bf690e494395e73274f98bb8 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 13e504aba88b6568fe1c76ba18dd5cb44bde9dcb..5228bab7ab716219f669b5176a060cab14edac8e 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 915fe8de4e13ad943a3f1445b253f9d5483c8c60..4b0cdb44714ed8ce05e7243235c83ccb5272eb37 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 b3b5b6ccc1c35b1cb0b9e8b4d8294cd3b6e8ac9e..0cdde8d8208d8ad89db57423ccdfa3393f0ef07a 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 68791034592a1ac4a546ab53a9a7e4766858b2fd..2937724c9e477131e943e77b45eed3537af936b3 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 03d93792a23a72f3b9a94982801b2a6d9376df7b..9978de4fee62a2b6a875590188a5d0aa4859cc5c 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 1d33c7324468f2039d42885edc99288c546e9495..46134277243feaa796d6e9ff890c688bfc8ab2eb 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 776f98ecd6584b4dbaa7159cc84836463c97b1b0..65f307b33f97771705346dbd23827f75b84da803 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 9bf8f0600918b56e3756271d894859f6f7f1f009..1549ee7852dc3fc0be1476f3194594f8e1d560bb 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 ebf975dc132f30f69e0de373259d04691b181132..ea6126f4662e655f2d0b55aa9ed0e1656000103a 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 cf8358a92e77b5b74acb245b80ee72473f415525..762c8bbce9982cd94c13c29346976627a5903146 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 9f1000c74751af294842e941cad46744ab9a0600..9e75e1eef4eab2634656c1e1aa34042f6283f158 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 3021093d5610427094bc4d327527819c84560f75..77ff80420ccd64d3cada7ca57ef872969ca36088 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 fef957b0ce787e32d00e2c3c3fb0e614199083b6..393228801b8853a54bc0fb03a0de5f49df36e6bb 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 2809cb65c237b39fcfa3087e1cec2799e9d1dd60..e36f9ad9fb2fdfa0d690d291c40645733be5d568 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 f8d1923c6b919bce3e05a5698ccc057b7e7cb4e7..07fcb1612f707c62e641c7d2bb9ea6d86d943c8e 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 86c878731226a9727ea7443809f9d8020dfbe873..67201a996fa840d0037fd9c6a9997577f3619950 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 34e1641e02b39adb7a7e46ef4adffa9988bdc821..b7ac72b6716f0bbe3bf9181bec6af2a5dbc60f5e 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 de325a33942a146495bc52b2a3d38d0ae5c6f319..5a59fb9f6f818856c4d56bf7102a5b4fe5f9db09 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 00ad7cfbbd182ed5002eab18573457d6fcd6e4a9..f57406d32de9a3164d9387e8f504ad658f50556e 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 5a9c1f146bcf2b7bb91682e05a9011a346b49356..02e553eb92512639775bc8d6780eecf7f70c7dc9 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 f2933a462bd4e16f50b0caf57e12bbb5cf57f700..a181811efe92c8d59a52a3a5bdbfe2c94abc60b2 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 934188ecaded9c5b434c03973b7bab4242f798be..061b7dacf8273a98dfeaf2b8c100fb4e2ddad434 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 85137c00265794f3b92e23e98a91f64eac260c67..e7b7325950ea5524d58d58d20f75ec947ee48bd2 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 c936139b10141f3e7d78adc5f923c5197e57b51d..d52a32e5b9dbe2294ac4055df9958968efde89e0 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 e541ca09c0c975c7bab59991a594696fb00b373f..4a4c5e3fb5fc71792c53b96eabc182cc95bd7b90 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 78620d3e6ea40aa8d6ac30b2eb40e624bf7b6b88..0dc9327221b2c63f1bf967a470d01287871b5239 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 53bb28f98e3b121420281190178052ceaba4bcd3..5d6fd637f50767f1b14d69962a15bee1d80a7437 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 8da7ffcc439bc460fba3bdc061a5e25765df1c4d..2c1d815f0268d2e7408f6a9fdaaa44e6aec3bf4e 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 e61f0a3673f5e9dc7cccc12bc3fdad52c50757a5..8f63e7058aeb3d405e119ea00725cd43ea9606de 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 4766544600d20a71c6ba91e9fc8cb2775b772d71..5a277cdb23d6f38f194172043d13f648b7648da4 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 015f506d7cf6388fc58065243302d4aa69ec1abd..dbcd62231289de30ff35f3e78ed744b6ccd281db 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 779deaf480bd0c49bf9f2c20e8de3fc120516d01..1eb2df4c2f288b5e87fff1bc0c65c8dce8490831 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 eb53a8cc13e98000736d554723dad127e8b5734f..a6afd0c2031c44290daffd0a15a497bb87dbe0a9 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 d0b5799a765337c603177e918643fd69214638ed..3fdc374e754f92aececc4301ef09fa67fee934f4 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 c39bccca90f8bd3154b41c15c0bd36eb69be6bbc..853db3f7a6095db06cacad1fc8838c8a517e8ec3 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 418c5fa2cc53d469525729766f015660573ad6ce..df38841a66c1c4393d0ddcdb170d4566be0d296e 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 31b450472f3b6095c717995a629a09a2e0e20388..093e48da068f92f839008a1106b2ddcda1d622bc 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 d2206a1092389c34c12a9b428dcd7bffb70c7105..fb2d3a9e619566eeb14f71a4c694b5b8b1665e77 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 011bcd8e7a9742069e5aa4f2b76fce4c65c9fc79..268fb9211e64bfa1d5f4341e62087a37d3bd37ac 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 fddd24394844afb28de0c8d4d743ddfda617d865..8ec27a1cd1215c1eed92c86f49b1708f1c01820b 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 b10787f2708b0fd0480b36077ec984df6678daa1..8075b1500c749d34b14ce234331117917c746063 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 ac90c170b7c750e5e65750c43f3e864c5c51ee68..e526241d8e36ec6a2bc090c26eea14aec1eb42f8 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 fa09007c7db5cff2d2594a93946394b5930db5f2..0e430bde3fd3508bd3ba7cb2f26bea44791e9963 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 75f400bee36180621a1b3a8f12f1aca2f28c3068..8e60bc4e0dad101bdcc0f51f616863813709258c 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 8c0290da09baa6ad3df0f1bf50130d3f5971a350..12d72803a80ba9b3c3b24d3d4e8c77b5daf0cc60 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 78318cca8101de1541e25bb60b856b544d8c9005..30c8ddf1f3e2bb97c54eb02eff05cb466c740ff7 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 eb157c05cdb1523604abe49dcf1a3ce2598a1dc6..1b356a04d99b872a9e9a85e86431d655ee1bcfc7 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 983acbe1cf6d107a9114cf109400d45c8538bfbd..92092833861b72f2779ad3c961f7af31e3d0981d 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 d28ebcfe1474c57771335c24664069e3e18a6baf..9faa3c3c278b159d57243ea9c874d8cdcc11620a 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 d90377c6271c817e98dddd2830c1ce3157156cc6..86b22f227c8628f95e0ce9bbc70971eb2963043f 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 b90f5fb899a77b6e98091e82b14dfcaacdc6c054..6e0cb62b470069a71cdff284d1e1b31c667c7dcd 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 7a5e4926f4acd0e9fa5e01f15eefbaca0db7e7bb..35377f2fb1dbaf339f1e2142277d1e6e9559d47f 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 a4f4529c839920a997f04a6c5053bea6a1a64e27..dfbf6411279a5495a0848a6ec54df93e082ce9b3 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 b404aaa9e6637fc26a7e3c855828f07c19a553e0..80020fa7ef2ccca8b660b418ef576bfda8f96d84 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 236635a92655b5071ac34c67bb6caff740bcee07..eae3e16781eafcb134f138cdb8d6cee60bd92626 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 bb63b59ad8f3fe6e09577211bf5c4b7fb42c5ad8..bb049f1e05a47c798516b49844bf33e0fa9cd836 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 4b23515741ccd39ad34fa810882bb6338b1c7826..7888ab9c360db7dbcdf8f0b6b55d02802e1eae02 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 13cc8545304f4bca3e8df0299c79f39e203e6fab..1198c054c7e4a46aacfc44455eab0cb45a03088f 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 802be2dd9fb00aa13d6b4f93ee0b8477570cd407..e0a71dc8d52f97ebba3d02acfcc61b1572ff3995 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 73a95f2c41aa5a655a7c5f86485ea3296dce6ad1..6cc5ec419ff8833f5d64bda422695242dbbd429e 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 e7ed89eefe0f3f8b88626e2964c3590e0d4a5dd9..a9ce26971aac626efce9e5bad267820c2d626c6a 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 da47ff946ac3e500b50129aa709032e168b49479..e8dd405e8d752be1801e0485f58391c9cb0f6fbd 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 c149c40593fd0da2dff5a76bc663a498301d8954..3244f03dbce2f403820a54d19fbdbb59ef73d6e0 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 fcace81defde9d4281124fa9c139b543344d74d1..bbc08a9672be96efa1ea7f989bda38ad166eb018 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 1cab9d884a580dcafaf15388b87847445bb10efa..6e445a0b871c4df1230c00e6eeefaad11cab8644 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 061a80055da2597ae40ca963a930bfc245920504..dc8ba25f97ddbd804e9234f34491f031b0335775 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 59a85d009d7cb0a665aa42091999547a06772008..5c9af8a2ab2b0a704a191b82f9d2452ae6a639f5 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 1fb0f12826213f1e03f40ec635b461c6570c679e..4ffa430fab7b2baf2dcee70da2aea69352a9ced4 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 2f3f84d2a66caf597b1f70aa1855fe25c979bbe5..c56c14fbaf0475dbb7c5306f3d5c7c274b338d7d 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 23fe0f2e43eab54f68996cffc0067ef26f0f6931..595424887d68d83693e21cccfc6c802f3ecf6da6 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 d4e3fee5ca05fe12af356fed79e6b128820c6a7c..61d444c947009febf5cfab6281d0946c64df398b 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 27611554ddab63c7ac764f854aeaa23f6e2ecac0..04ffb5c422cbe057231600f6f31a79779ece3f4e 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 7b8bdeff11d466edee9f8aa22d91aed50c3f5c74..199d43e3940cfe445d824830dbae1816bd063cce 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 f1c644ffbe34f74792fde8cf83382831131c3a70..9a0c8b197a096f0e6a534f9a5ac886d2082b8e62 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 df63165cdd3b359ead57f28a107a1e784248dd60..83dc74ad3d5976149b0fd6067710bcfd45df47c9 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 4eee6faa1d183a8224dff0ee62549348ea9557f1..ff21e3316d1c67b0ad78fc6b1349723d0224ce55 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 5eb9a84ff6de5734c436a3004b4a422f9f14a08d..036a7038651ee6b9334ec3c1fdd2a4d2ef2a20e5 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 5e690d35239497751d0c24224d816e4550cb0b2a..467350d87c0c1999a768f0b60fb09fa1a8c95e20 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 61083d8e41f1959e630a0ea993c7b0379f512493..9db1998b5fed58db254b920d2b3d6a75999af7a4 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 4ba8ddcd456f7506a166cfcdc8b5dac3f0a56fcc..e69abc72b6ba74a7c6dbfe811b7f24b8b5c13e29 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 ec47d0ac8c90bc73fd18d012bd5bb66c35554237..672af4d861a5cfbad58a7fc93c18ebf03770f19a 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 6e57df736645f0eb2d1eaae02231b055a9633da1..fd8b23eb30d3e7bd89888cf469ce1d5ed3b39b7c 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 9b69702dc30e469c9ad07990c8c15f4211f45571..6a57b59ff6e6f92661374dd64ba8e09a93d681dc 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 4d2ddff8f46d611719aaf7258ccfcf201a573030..24bc9dff34875e33d9f51dd40b05650ce04ccecd 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 7539130fb3fa655bb302e28c78d1dcbd54c12f47..def6f012cf1f37ba3b0d21b97f649c196720cfaf 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 89181aed85ffa8721ff8acb36faf24cc0f839c09..19ca09edee20cb1383c75759bae9e90e8a302884 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 f8ddeeecca5f7c44e3ffce2d0377669bda9f345f..efc02456a7ca3174c82cb082c8b74f474e06a7a5 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 8f645d49bf9580c89eec81222a2f95443783d55b..455a642676d47bfd91438c7e469bc31cfc9f7925 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 7279c92349e0f615eb46133689af6151865e3b0d..791d1af0d6c675cd90916a7da36a528721233cf2 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 ebd639110d27590fade78e9bed4786d8e161cd2a..0a17eff2b698e8910f71ef3991a77ea9d5ca1f6f 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 ec0756d6cece96b0919934d491fec72e71c82915..61a1a3f99ddf2a92e070fcb576b4735b8a0a92c9 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 e16f74e72125b491871277c48e6cf41161ea8101..666edc441b29ea8672d35b02ae84777334ba5b50 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 81f717ba36349f05c67b6703fa4454c49e568d53..f31470f6230766b6946c2f9543813c92095ce117 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 3cf88c29fe5a011306f593b465c5c68d037e8ba0..1a79ce2eaf38b487848c7cc4e673e0be731832d6 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 c03e60dadca2a75037dc7d6f986c5b8c7a120502..82844f7c14267afba445fb76446cdf2a107698cc 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 2844a1112d9bbe1c61f81025e4208fed26ce3769..621cc22d4907968fb6b36934973164cd91bcef2a 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 54d6e284ecadf522905d9887e4713eed56f36933..c2c65aec8ff55eef7667d4a726c82e06d6aba331 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 1c10d784c539b778eec385133de45aae84d7a719..465f03d93b62fb4f6ffe83815a76c52c011d3b2d 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 7fd94599461584297f64b7c344908d9ce4c96352..8a748a8bf139311ce3b658b50f4ca37c4b9fd76c 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 6dcb0ba285c91ef48a9760bedfd23943e9a78493..3b39bc22e23975037a9855dee9b119e013f9e7b9 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 63eaf9607021a31fce0d92ab57579e59c95637e5..e6801a0b9ba0c0333341e525bffb43850d39e694 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 7683080c6a223a2fa40b0002b33e1bb3c4056712..8f08dfd7730de962e0c8471ff4689bbb57d1e49c 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 71e8eb2c0ef9c1810d7e3ffb68b88f6e762615b4..30d079816ccfcdf32e9bd2aa21aa352299f36993 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 e703ae5bbf5e03ed724ec0860db81d94369d7b05..8fd768e2dbaadf06ba611489df2781b2a6521fb9 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 9a38dbebdb034bc4b6300e42d8096724ce035d96..756a9822502c9d269324cd758a87a5bc50e0d9d9 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 ef699515cc5d2c1973eae3dbd1453c556c0c13cd..e9af95d1a757d4ef81b0c884c2c872404bda3e60 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 078f06d02e33ae52c17ed65d06b877c67a2e9347..5de45f6b3543df6ee878f67043ef304f9be269d4 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 024ed4f7cc02acf2a9210bacafde339bd669ac48..bf495741f34b50f317a845f91d49e8ed14a5cba2 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 3c43c07ef93a07c85331c46401feb2fc9f216cc0..537bc1823e39470fed18b86cdd0558cf0b918fee 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 49e9d9d80ab6fe18e5af749e4a88e330d34f9a44..36115cb3fccc007ec1a242868b66cf0982790c1c 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 4a698dd269c82b5606a1605ea8fc078b7655d2d6..b0a76cc98e9f1ffed3eb5b32971653db807163bf 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 36d08b62231aaf859e2b4565fcab7022afdf2aef..70cdd1d9fb57d76bac85a3dd7e9383729a7b7522 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 292a707120ee5c7d98580550dbc37b76bb3557a7..7a1dc81cca03aa7f6eb070ea72ea734d0b0467fe 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 c69d6c58e2685e2064ba1e20590d3f63f8e9c0b8..4cc1be3b3411f31de5a295aac8ad86f95398d166 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 b3d989a9d7a32bede8fe28288596292919966712..2e9dbb431f7c2df47f3bb902556ab6830e2d1313 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 2ee67815c61ad67b9cd82ba76fab73bea5b7f8f0..6444609dee1f2d4de4fa2ac689c7cf5f3e39e37f 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 ab979d0341e0d0db4e5efd7edd7019c1b00ddcfd..dda54944f95e0de48be009f86709dabc77415d9c 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 0777dbe29192c74f8264bb38c6a1dfe8b7aad547..4bd224f220ed27dfa5f1cd2eedefbaf11f677332 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 bcbaffe317551fec705eda6d37d601d1586ac43f..616822e1fc6d4092903d11d7b642344ef253c62f 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 542cda5b0409c0cd00da536f4408c41e955e9272..6487fd9297a017ec99b8f554ea3b88e08e084161 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 acc0c0a2d6b019a92f58fa001e3af7f66d84637a..ccdafac4afaba61ff4f6bdc91c5ae9fe253a1c19 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 d476381fe9e4f20b68ae801c9691f4501a62f1c1..009734858aa0a731f932a01fb5625d55213c4b55 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 82317a141c492aad2f211436435c9a74d539772f..70b3c651e0e9913cfa4acb4e6b2d0bbee3c77f00 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 5d4c34ee4cc356ffd8cd063ffe96f0a205d3efc4..cf029cb4bb2f474a1bfb5a9d73f65547c7fdc1b5 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 5ff2a7502728c7a793ae761f3c8798005d8d0173..2dda2ab49a4f676f23b6160eb2310d53d9a4e5fb 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 0f4663f994e5645ba5730d1c21c58a3eedd29ee0..23263f96136c0462720545a21d5ad9c99e661904 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 a756d78414f0c4023fe868591860e8ed0697d2c1..b9eac52961ef09a4c214777ef0dc646b98b6d280 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]');