diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js index 889c353bcb8eb3df58a42734443cf743158d1581..68068f4525e25a8ad186a7f9c1d5e0f111cb6065 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.14-0-1 description: Array.prototype.indexOf must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Array.prototype.indexOf; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js index 7f42405736cdc5539f1eaff378fbfc562f92d758..3294781683e057ad5a3b54d50a2dd0484a095eba 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.4.4.14-0-2 description: Array.prototype.indexOf has a length property whose value is 1. -includes: [runTestCase.js] ---*/ -function testcase() { - if (Array.prototype.indexOf.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.length, 1, 'Array.prototype.indexOf.length'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js index 05a2998206673f6bdad3e3b2ae04136ced1e3c84..541896c6f69b20beb6a756d8ecdc58c7280e3a07 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-11.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.14-1-11 description: Array.prototype.indexOf applied to Date object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new Date(); obj.length = 2; obj[1] = true; - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js index 65385526f43f8436cd55ba99f02ba23bef1840f7..e3ca3790b6b2559d277f6ecfba1f64695520eabb 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-12.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.14-1-12 description: Array.prototype.indexOf applied to RegExp object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new RegExp(); obj.length = 2; obj[1] = true; - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js index a1e79dd3fb45abe05d624284506d3fb22e7eeb52..1157291e5dd51e40afeede311b9146d5810ed6fd 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-14.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.14-1-14 description: Array.prototype.indexOf applied to Error object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new SyntaxError(); obj[1] = true; obj.length = 2; - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js index 7cca86643c774946bdcb3bd1a63825cfd198f55b..4b28849c526c28f5d33947b56ab456a4bf9eced9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-15.js @@ -4,16 +4,11 @@ /*--- es5id: 15.4.4.14-1-15 description: Array.prototype.indexOf applied to Arguments object -includes: [runTestCase.js] ---*/ -function testcase() { - function fun() { return arguments; } var obj = fun(1, true, 3); - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js index 06cfe2c7a27aeb18efb9e8c4dc474475289df16c..c9d7e1ab9d953e5892b6d04561edd9048ce4764c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-4.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.14-1-4 description: Array.prototype.indexOf applied to Boolean Object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new Boolean(false); obj.length = 2; obj[1] = true; - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js index c9bbd1a6f855a7d44356185a62ce908fcc783951..c1a21c1a369e6a4565ec0c7a440153e8c2424adf 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-6.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.14-1-6 description: Array.prototype.indexOf applied to Number object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new Number(-3); obj.length = 2; obj[1] = true; - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js index 07190e6d154b3d6901da0dae327d4e4758b00962..9e365b78ae9cbedb391733c1fc64f8b86cff08b4 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-8.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.14-1-8 description: Array.prototype.indexOf applied to String object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new String("null"); - return Array.prototype.indexOf.call(obj, 'l') === 2; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 'l'), 2, 'Array.prototype.indexOf.call(obj, "l")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js index c84d1fb1b5229a6c2306f0dcad34f10c86370453..c3f0b9aa6b14129d02f9ba6086f54606e46bd264 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-9.js @@ -4,16 +4,11 @@ /*--- es5id: 15.4.4.14-1-9 description: Array.prototype.indexOf applied to Function object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = function (a, b) { return a + b; }; obj[1] = true; - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js index faab872df540ccc96825a6f0e172260fd412a8f8..ba0db2af3684e6b516223bc98d2b20a9e2634b39 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-2.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-10-2 description: > Array.prototype.indexOf returns -1 if 'length' is 0 and does not access any other properties -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; var f = {length: 0}; Object.defineProperty(f,"0",{get: function () {accessed = true; return 1;}}); @@ -17,8 +15,6 @@ function testcase() { var i = Array.prototype.indexOf.call(f,1); - if (i === -1 && accessed==false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js index e1a2404b63cb844d794af4060fce9b735c02fb4a..45b2ad893d6c097f715de02e10d378bf0c15eb05 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-1.js @@ -6,13 +6,10 @@ es5id: 15.4.4.14-2-1 description: > Array.prototype.indexOf - 'length' is own data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var objOne = { 1: true, length: 2 }; var objTwo = { 2: true, length: 2 }; - return Array.prototype.indexOf.call(objOne, true) === 1 && - Array.prototype.indexOf.call(objTwo, true) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(objOne, true), 1, 'Array.prototype.indexOf.call(objOne, true)'); +assert.sameValue(Array.prototype.indexOf.call(objTwo, true), -1, 'Array.prototype.indexOf.call(objTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js index 144ec76973e5cf43ffdc5e2386ccd6c2910baa24..7de29bc268730025f73417cb6a8f4158d114a105 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-10.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.14-2-10 description: Array.prototype.indexOf - 'length' is inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = {}; Object.defineProperty(proto, "length", { get: function () { @@ -25,7 +22,5 @@ function testcase() { var childTwo = new Con(); childTwo[2] = true; - return Array.prototype.indexOf.call(childOne, true) === 1 && - Array.prototype.indexOf.call(childTwo, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(childOne, true), 1, 'Array.prototype.indexOf.call(childOne, true)'); +assert.sameValue(Array.prototype.indexOf.call(childTwo, true), -1, 'Array.prototype.indexOf.call(childTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js index 4e4649ba6bc303535292af4c243210a5c848ffc3..db7f2dde9387640d423d03e3b2a9308b6d5ed697 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-11.js @@ -6,17 +6,12 @@ es5id: 15.4.4.14-2-11 description: > Array.prototype.indexOf - 'length' is own accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: true }; Object.defineProperty(obj, "length", { set: function () { }, configurable: true }); - return Array.prototype.indexOf.call(obj, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js index 0d49b2f827f570c4109275575b7a263b33244c06..e5ce782fd12ad2c5364805d45a329801798c8d1b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-2-13 description: > Array.prototype.indexOf - 'length' is inherited accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = {}; Object.defineProperty(proto, "length", { set: function () { }, @@ -23,6 +20,4 @@ function testcase() { var child = new Con(); child[1] = true; - return Array.prototype.indexOf.call(child, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(child, true), -1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js index efbc591db073a5e443609aee2d48374ceb53e120..5d8470f4ee623349d7813401992e5a68af0bdbad 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-14.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.14-2-14 description: Array.prototype.indexOf - 'length' is undefined property -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: true, 1: true }; - return Array.prototype.indexOf.call(obj, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js index dec55b06b3a576d48ca888cf6ed34449b6b8456f..41db1ed20aeebac864e80518d65607888f13a8aa 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-17.js @@ -6,17 +6,12 @@ es5id: 15.4.4.14-2-17 description: > Array.prototype.indexOf applied to Arguments object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var func = function (a, b) { arguments[2] = false; return Array.prototype.indexOf.call(arguments, true) === 1 && Array.prototype.indexOf.call(arguments, false) === -1; }; - return func(0, true); - } -runTestCase(testcase); +assert(func(0, true), 'func(0, true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js index 3564c4bfee94680cd8f2fa77f8ea66987cd01f88..fdd7043ec6bc9391ebdb418f9afc0c6838e91a02 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-19.js @@ -6,18 +6,13 @@ es5id: 15.4.4.14-2-19 description: > Array.prototype.indexOf applied to Function object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = function (a, b) { return a + b; }; obj[1] = "b"; obj[2] = "c"; - return Array.prototype.indexOf.call(obj, obj[1]) === 1 && - Array.prototype.indexOf.call(obj, obj[2]) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, obj[1]), 1, 'Array.prototype.indexOf.call(obj, obj[1])'); +assert.sameValue(Array.prototype.indexOf.call(obj, obj[2]), -1, 'Array.prototype.indexOf.call(obj, obj[2])'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js index efc2074243dcae5f06b0200815c71d99a1913efe..541996a5d233c7a382c51b0f5f2418db76b553ce 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-2-3 description: > Array.prototype.indexOf - 'length' is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = { length: 0 }; var Con = function () {}; @@ -20,6 +17,4 @@ function testcase() { child.length = 2; child[1] = true; - return Array.prototype.indexOf.call(child, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js index 48efb0e92f260c329c8e70193a50c0a30300575c..40b169ae143c9851e05d1c632c460df82c5a046f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-5.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-2-5 description: > Array.prototype.indexOf - 'length' is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "length", { get: function () { @@ -29,6 +27,4 @@ function testcase() { }); child[1] = true; - return Array.prototype.indexOf.call(child, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js index f18cea0082fea8cd27edb980a6f4ebdb53d580bd..e06a19566c380498b91629a1ce247c1c1000af83 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-6.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.14-2-6 description: Array.prototype.indexOf - 'length' is an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { var proto = { length: 2 }; var Con = function () {}; @@ -18,7 +16,5 @@ function testcase() { var childTwo = new Con(); childTwo[2] = true; - return Array.prototype.indexOf.call(childOne, true) === 1 && - Array.prototype.indexOf.call(childTwo, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(childOne, true), 1, 'Array.prototype.indexOf.call(childOne, true)'); +assert.sameValue(Array.prototype.indexOf.call(childTwo, true), -1, 'Array.prototype.indexOf.call(childTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js index 77de93d98a182f2ce57b2e89a0942588471ba078..67b3bf1ad42658322ea6eefd3677a323c271d218 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-7.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.14-2-7 description: Array.prototype.indexOf - 'length' is own accessor property -includes: [runTestCase.js] ---*/ -function testcase() { var objOne = { 1: true }; var objTwo = { 2: true }; Object.defineProperty(objOne, "length", { @@ -23,7 +21,5 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(objOne, true) === 1 && - Array.prototype.indexOf.call(objTwo, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(objOne, true), 1, 'Array.prototype.indexOf.call(objOne, true)'); +assert.sameValue(Array.prototype.indexOf.call(objTwo, true), -1, 'Array.prototype.indexOf.call(objTwo, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js index 67f7c5610868a127ef962b2cfa4ad0f47c5dc72f..94ab647feb965610a731304e0a93655f8cb71372 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-2-8 description: > Array.prototype.indexOf - 'length' is own accessor property that overrides an inherited data property -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = { length: 0 }; var Con = function () {}; @@ -26,6 +23,4 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(child, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js index 565d2b05182fedb2043af5e213f6d4181307754c..ce988c07e85bfa56874970f97b5887dacad6d0ff 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-9.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-2-9 description: > Array.prototype.indexOf - 'length' is own accessor property that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "length", { get: function () { @@ -31,6 +29,4 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(child, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(child, true), 1, 'Array.prototype.indexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js index 6c689093b8b0105a13dc732132b645dddbd5d9ef..41fd56d6df2a590e9178b6b3a2bdd4471f54037c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.14-3-1 description: Array.prototype.indexOf - value of 'length' is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 1, 1: 1, length: undefined }; - return Array.prototype.indexOf.call(obj, 1) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 1), -1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js index 14d7615c48d675751a78926350dae1a08eda8a9f..06053b3aff232ecc994028f259d5f3f050adb247 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-10.js @@ -6,13 +6,8 @@ es5id: 15.4.4.14-3-10 description: > Array.prototype.indexOf - value of 'length' is number primitive (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 0, length: NaN }; - return Array.prototype.indexOf.call(obj, 0) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 0), -1, 'Array.prototype.indexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js index 3a9e1b7f090e8b7bb1dc6fd5e2423a451a7057cb..e90d3d928533e43704bd94f57d2519149b3c7b6b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-11.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-11 description: > Array.prototype.indexOf - 'length' is a string containing a positive number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: 1, 2: 2, length: "2" }; - return Array.prototype.indexOf.call(obj, 1) === 1 && - Array.prototype.indexOf.call(obj, 2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 1), 1, 'Array.prototype.indexOf.call(obj, 1)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 2), -1, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js index b7e3f9dc4efdb23cc8ad1cafd9c3855c564122f8..643b4d4e9e8f1e4453eac8bb273a581a03ad74a9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-12.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-12 description: > Array.prototype.indexOf - 'length' is a string containing a negative number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: "true", 2: "2", length: "-4294967294" }; - return Array.prototype.indexOf.call(obj, "true") === -1 && - Array.prototype.indexOf.call(obj, "2") === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, "true"), -1, 'Array.prototype.indexOf.call(obj, "true")'); +assert.sameValue(Array.prototype.indexOf.call(obj, "2"), -1, 'Array.prototype.indexOf.call(obj, "2")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js index 64ec99e30c19790cf0fb42ddef6b610b548a5d2f..8d644bbdfe26a5b5ae1913cb6b4b08b712ec38ea 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-13.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-13 description: > Array.prototype.indexOf - 'length' is a string containing a decimal number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 199: true, 200: "200.59", length: "200.59" }; - return Array.prototype.indexOf.call(obj, true) === 199 && - Array.prototype.indexOf.call(obj, "200.59") === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 199, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, "200.59"), -1, 'Array.prototype.indexOf.call(obj, "200.59")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js index e05bebdecbad4380d31313489b1afaa654a80943..f5b7886b08151690f8136a099576741d9f8c082e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-14.js @@ -6,17 +6,12 @@ es5id: 15.4.4.14-3-14 description: > Array.prototype.indexOf - 'length' is a string containing +/-Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - var objOne = { 0: true, 1: true, length: "Infinity" }; var objTwo = { 0: true, 1: true, length: "+Infinity" }; var objThree = { 0: true, 1: true, length: "-Infinity" }; - return Array.prototype.indexOf.call(objOne, true) === 0 && - Array.prototype.indexOf.call(objTwo, true) === 0 && - Array.prototype.indexOf.call(objThree, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(objOne, true), 0, 'Array.prototype.indexOf.call(objOne, true)'); +assert.sameValue(Array.prototype.indexOf.call(objTwo, true), 0, 'Array.prototype.indexOf.call(objTwo, true)'); +assert.sameValue(Array.prototype.indexOf.call(objThree, true), -1, 'Array.prototype.indexOf.call(objThree, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js index 57ecb5d047030596cca45441595d8b0ad5050b7a..e186bf5c1badccef1d31c9855ebbf5fc8f8a8f31 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-15.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-15 description: > Array.prototype.indexOf - 'length' is a string containing an exponential number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: true, 2: "2E0", length: "2E0" }; - return Array.prototype.indexOf.call(obj, true) === 1 && - Array.prototype.indexOf.call(obj, "2E0") === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, "2E0"), -1, 'Array.prototype.indexOf.call(obj, "2E0")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js index 636f1031dfc3460cb615cd2b2006481b11c1a22b..f4baaa83d5acadd68e4870add5a90ede511eb37a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-16.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-16 description: > Array.prototype.indexOf - 'length' is a string containing a hex number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 10: true, 11: "0x00B", length: "0x00B" }; - return Array.prototype.indexOf.call(obj, true) === 10 && - Array.prototype.indexOf.call(obj, "0x00B") === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 10, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, "0x00B"), -1, 'Array.prototype.indexOf.call(obj, "0x00B")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js index 4655af5727ed0b42bda3dc3ee8eed4d3122ae7b0..d78900dfdca349268b8eea690f54edbbd2dd7544 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-17.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-17 description: > Array.prototype.indexOf - 'length' is a string containing a number with leading zeros -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: true, 2: "0002.0", length: "0002.0" }; - return Array.prototype.indexOf.call(obj, true) === 1 && - Array.prototype.indexOf.call(obj, "0002.0") === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, "0002.0"), -1, 'Array.prototype.indexOf.call(obj, "0002.0")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js index c9f3a4e4001247555425a8cdc8a564c39d47c239..8f46145d9e3cab6028f509f7a8ef3b93dc6f812e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-18.js @@ -6,13 +6,8 @@ es5id: 15.4.4.14-3-18 description: > Array.prototype.indexOf - value of 'length' is a string that can't convert to a number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: true, 100: true, length: "one" }; - return Array.prototype.indexOf.call(obj, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js index 0e8b4bc353efc5fdb1b988221125c6778fb1e6b9..a69172fd7e9cd697d1d4a3e3ecf27b3f294c08be 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-3-19 description: > Array.prototype.indexOf - value of 'length' is an Object which has an own toString method. -includes: [runTestCase.js] ---*/ -function testcase() { - // objects inherit the default valueOf() method from Object // that simply returns itself. Since the default valueOf() method // does not return a primitive value, ES next tries to convert the object @@ -28,7 +25,5 @@ function testcase() { } }; - return Array.prototype.indexOf.call(obj, true) === 1 && - Array.prototype.indexOf.call(obj, 2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 2), -1, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js index 22a09176479403a3ad1d373d5fe2e01bf180e549..03b9d15e982d7c9df0e92333d8cf170a8c1b1594 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-2.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-3-2 description: > Array.prototype.indexOf return -1 when 'length' is a boolean (value is true) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 0: 0, 1: 1, length: true }; - return Array.prototype.indexOf.call(obj, 0) === 0 && - Array.prototype.indexOf.call(obj, 1) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 1), -1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js index b8d6fa363d80f8a79526567710520ba9feb3e9b6..50507e59e9057f853d40639e2f4cbac27dc6f87b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-3-20 description: > Array.prototype.indexOf - value of 'length' is an Object which has an own valueOf method. -includes: [runTestCase.js] ---*/ -function testcase() { - //valueOf method will be invoked first, since hint is Number var obj = { 1: true, @@ -22,7 +19,5 @@ function testcase() { } }; - return Array.prototype.indexOf.call(obj, true) === 1 && - Array.prototype.indexOf.call(obj, 2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 2), -1, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js index 7cabb1e776ea6ce5da40d94096b39903d180d469..968de409898b2f8483183929c80d2b23d9a0729f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-21.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - '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 toStringAccessed = false; var valueOfAccessed = false; @@ -30,6 +27,6 @@ function testcase() { } }; - return Array.prototype.indexOf.call(obj, true) === 1 && toStringAccessed && valueOfAccessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js index 5d7fc6cf0bd647f41c965ddbe1f08a30fe656bb8..04c758010c67bb5b260603f58f8fea6404285bb2 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-23.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf uses inherited valueOf method when 'length' is an object with an own toString and inherited valueOf methods -includes: [runTestCase.js] ---*/ -function testcase() { - var toStringAccessed = false; var valueOfAccessed = false; @@ -36,6 +33,6 @@ function testcase() { length: child }; - return Array.prototype.indexOf.call(obj, true) === 1 && valueOfAccessed && !toStringAccessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(toStringAccessed, false, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js index b246c532f63cfcd292b57c23686854d670de88d7..68d426e31adfac42ed99e702a198dabc6685fc32 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-24.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-24 description: > Array.prototype.indexOf - value of 'length' is a positive non-integer, ensure truncation occurs in the proper direction -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 122: true, 123: false, length: 123.321 }; //length will be 123 finally - return Array.prototype.indexOf.call(obj, true) === 122 && - Array.prototype.indexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 122, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js index 48b98da80f2abafa1fc972637ba93aa87c561755..a2477b8e96203c6b7384d6f31d5f4fa30d44978a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-25.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-25 description: > Array.prototype.indexOf - value of 'length' is a negative non-integer -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: true, 2: false, length: -4294967294.5 }; //length will be 0 finally - return Array.prototype.indexOf.call(obj, true) === -1 && - Array.prototype.indexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js index 085a5a08070780de112deb2b3b9acde136c38b67..7b16b7668d4b22d2135700d3998ff5aef825c31d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-28.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-3-28 description: > Array.prototype.indexOf - value of 'length' is boundary value (2^32) -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; var obj = { 0: targetObj, @@ -18,6 +16,4 @@ function testcase() { length: 4294967296 }; - return Array.prototype.indexOf.call(obj, targetObj) === 0; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), 0, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js index d14d06a6522266cffe1aae4c8c623441fb5489ae..473b9cfc71fbc80969a1b38bf9ee840b9e379783 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-29.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-3-29 description: > Array.prototype.indexOf - value of 'length' is boundary value (2^32 + 1) -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; var obj = { 0: targetObj, @@ -17,7 +15,5 @@ function testcase() { length: 4294967297 }; - return Array.prototype.indexOf.call(obj, targetObj) === 0 && - Array.prototype.indexOf.call(obj, 4294967297) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), 0, 'Array.prototype.indexOf.call(obj, targetObj)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 4294967297), 1, 'Array.prototype.indexOf.call(obj, 4294967297)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js index 77dcb9ed8be916dcecb986e29f70cbe3718716fc..a0c8b623480bd66afdbe4dd76f47edf4da292d06 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-3.js @@ -6,13 +6,8 @@ es5id: 15.4.4.14-3-3 description: > Array.prototype.indexOf - value of 'length' is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: true, length: 0 }; - return Array.prototype.indexOf.call(obj, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js index a2171ffc04e0fa694a7ab0a0fa125c1a27711bf1..255b93b6b9d5cd7724c996b6c9b8d12a120e43b9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-4.js @@ -6,13 +6,8 @@ es5id: 15.4.4.14-3-4 description: > Array.prototype.indexOf - value of 'length' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: true, length: +0 }; - return Array.prototype.indexOf.call(obj, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js index 2a5e462c717faca86e362e15d372868e88b300ea..0e97d0a83cc7bc790ed50e9bfc62cb3b0b4937a7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-5.js @@ -6,13 +6,8 @@ es5id: 15.4.4.14-3-5 description: > Array.prototype.indexOf - value of 'length' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: true, length: -0 }; - return Array.prototype.indexOf.call(obj, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js index 4c7abe56ae5514f6c3c9fa9815279cb1aa0cb45d..64d6c02837718dba956453f47dc77728f13ef65b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-6.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-6 description: > Array.prototype.indexOf - value of 'length' is a number (value is positive) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 3: true, 4: false, length: 4 }; - return Array.prototype.indexOf.call(obj, true) === 3 && - Array.prototype.indexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 3, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js index 13707d9704655423488dd18992f94f6472e44cbc..8f98d39e190aebcae9b91383404b16b07b737c0f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-7.js @@ -6,14 +6,9 @@ es5id: 15.4.4.14-3-7 description: > Array.prototype.indexOf - value of 'length' is a number (value is negative) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 4: true, 5: false, length: 5 - Math.pow(2, 32) }; - return Array.prototype.indexOf.call(obj, true) === -1 && - Array.prototype.indexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), -1, 'Array.prototype.indexOf.call(obj, true)'); +assert.sameValue(Array.prototype.indexOf.call(obj, false), -1, 'Array.prototype.indexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js index e15f48ee2fadeef113020f94f17c5ab06e291886..d63ab41c6cbfca4e9660bd40990c0b1deb2cac1c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-8.js @@ -6,13 +6,8 @@ es5id: 15.4.4.14-3-8 description: > Array.prototype.indexOf - value of 'length' is a number (value is Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 0, length: Infinity }; - return Array.prototype.indexOf.call(obj, 0) === 0; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js index 91846b01be9eb860a3f60bfb52d84a1322b36057..dfc8372b3eca5b8da4fd32072a0ece030cb69658 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-9.js @@ -6,13 +6,8 @@ es5id: 15.4.4.14-3-9 description: > Array.prototype.indexOf - value of 'length' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 0, length: -Infinity }; - return Array.prototype.indexOf.call(obj, 0) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 0), -1, 'Array.prototype.indexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js index ab9f59df6608437083f81d155232fd0e836b4d91..b48fcc17b63e483a3265984190c1d1aee33a686c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.14-4-1 description: Array.prototype.indexOf returns -1 if 'length' is 0 (empty array) -includes: [runTestCase.js] ---*/ -function testcase() { var i = [].indexOf(42); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js index 9588ef9afb8598beb6e7024ba46b74e09b2adaa8..f3a850eb821b696de576aae53bb365e7a4a67d35 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-10.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.14-4-10 description: Array.prototype.indexOf - 'length' is a number of value -6e-1 -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = []; var obj = { 0: targetObj, 100: targetObj, length: -6e-1 }; - return Array.prototype.indexOf.call(obj, targetObj) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), -1, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js index a39ed1b8438436bb2c824f5d81e37b54f099a259..0cdf6c64e25328f67084495fe4e796317806e999 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-11.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.14-4-11 description: Array.prototype.indexOf - 'length' is an empty string -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = []; var obj = { 0: targetObj, 100: targetObj, length: "" }; - return Array.prototype.indexOf.call(obj, targetObj) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), -1, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js index e3ea53cee7c5bd23f93f6549f1fc942c7e75a110..d1aa31e7ea81ee708e600683d07fef7545d3130f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-2.js @@ -6,15 +6,9 @@ es5id: 15.4.4.14-4-2 description: > Array.prototype.indexOf returns -1 if 'length' is 0 ( length overridden to null (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.indexOf.call({length: null}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js index 51905e6244b3a5bd3def2a068a4fabf79b3f1fbb..455e8690c3084f0c78d5f0b68db9e4090ed80886 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-3.js @@ -6,15 +6,9 @@ es5id: 15.4.4.14-4-3 description: > Array.prototype.indexOf returns -1 if 'length' is 0 (length overridden to false (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.indexOf.call({length: false}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js index 820b44c3e90b056e1f6862846d4781a0d778b804..a507da531f5df8fc2462c6f104e67221acafca6c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-4.js @@ -6,15 +6,9 @@ es5id: 15.4.4.14-4-4 description: > Array.prototype.indexOf returns -1 if 'length' is 0 (generic 'array' with length 0 ) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.lastIndexOf.call({length: 0}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js index acca7d7d277cb1f8f59b6c5b908644782863c2c1..a96cde499a5f542ead7cdfe8bd6a9de3227ddf19 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-5.js @@ -6,15 +6,9 @@ es5id: 15.4.4.14-4-5 description: > Array.prototype.indexOf returns -1 if 'length' is 0 ( length overridden to '0' (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.indexOf.call({length: '0'}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js index f4c8d65ed126e6b9da812f6293d8b6088e62a2d1..79a8acb8dbace1b90296b1b8e45de949e28bd6df 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-6.js @@ -6,15 +6,9 @@ es5id: 15.4.4.14-4-6 description: > Array.prototype.indexOf returns -1 if 'length' is 0 (subclassed Array, length overridden with obj with valueOf) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.indexOf.call({length: { valueOf: function () { return 0;}}}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js index 10cf42c3856ff2fd7bc25e27a2088a32599d2050..299eae0204149bb4ee1cccc4fe567f2ee61f71e9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-7.js @@ -6,12 +6,8 @@ es5id: 15.4.4.14-4-7 description: > Array.prototype.indexOf returns -1 if 'length' is 0 ( length is object overridden with obj w/o valueOf (toString)) -includes: [runTestCase.js] ---*/ -function testcase() { - - // objects inherit the default valueOf method of the Object object; // that simply returns the itself. Since the default valueOf() method // does not return a primitive value, ES next tries to convert the object @@ -19,8 +15,5 @@ function testcase() { // resulting string to a number. var i = Array.prototype.indexOf.call({length: { toString: function () { return '0';}}}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js index 1da43946be0d747cb6bb270dc404ace5b2a5bd49..b066833f1f7803427badb69917d7391ecadea962 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-8.js @@ -6,12 +6,8 @@ es5id: 15.4.4.14-4-8 description: > Array.prototype.indexOf returns -1 if 'length' is 0 (length is an empty array) -includes: [runTestCase.js] ---*/ -function testcase() { - - // objects inherit the default valueOf method of the Object object; // that simply returns the itself. Since the default valueOf() method // does not return a primitive value, ES next tries to convert the object @@ -27,8 +23,5 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. var i = Array.prototype.indexOf.call({length: [ ]}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js index 32162208b017ab34e724012419438a9dad87a78b..f418fbd8513b0308147c444f180a592108178a75 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-4-9.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.14-4-9 description: Array.prototype.indexOf - 'length' is a number of value 0.1 -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = []; var obj = { 0: targetObj, 100: targetObj, length: 0.1 }; - return Array.prototype.indexOf.call(obj, targetObj) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(obj, targetObj), -1, 'Array.prototype.indexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js index 59fee7a763a2fde2e4609654e6a3f6afe7bdbb86..6bcf1d59b898a4f50d417f550b00ad17a58c7a7e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-10.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-10 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is positive number) -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, 2].indexOf(targetObj, 2) === -1 && - [0, 1, targetObj].indexOf(targetObj, 2) === 2; - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, 2].indexOf(targetObj, 2), -1, '[0, targetObj, 2].indexOf(targetObj, 2)'); +assert.sameValue([0, 1, targetObj].indexOf(targetObj, 2), 2, '[0, 1, targetObj].indexOf(targetObj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js index f6677bce7bf9e61a0081dcfedf759a74565a728f..27d0d463bc372f0e617cd3c2f3612e68f7ee9758 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-11.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-11 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is negative number) -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, 2].indexOf(targetObj, -1) === -1 && - [0, 1, targetObj].indexOf(targetObj, -1) === 2; - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, 2].indexOf(targetObj, -1), -1, '[0, targetObj, 2].indexOf(targetObj, -1)'); +assert.sameValue([0, 1, targetObj].indexOf(targetObj, -1), 2, '[0, 1, targetObj].indexOf(targetObj, -1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js index 88d90a0ae94daa497f26bad95d2c47732d30eb93..cbd2f0b275a932c586a237a857229c48395b5a31 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-12.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-12 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { var arr = []; arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type - return arr.indexOf(true, Infinity) === -1; - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf(true, Infinity), -1, 'arr.indexOf(true, Infinity)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js index c6228091e4f384e59f3fb1bcf30323cb1afd43fa..e838aa171000ca37511f1e70e8f0c14e27f3ef22 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-16.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-16 description: > Array.prototype.indexOf - value of 'fromIndex' is a string containing Infinity -includes: [runTestCase.js] ---*/ -function testcase() { var arr = []; arr[Math.pow(2, 32) - 2] = true; //length is the max value of Uint type - return arr.indexOf(true, "Infinity") === -1; - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf(true, "Infinity"), -1, 'arr.indexOf(true, "Infinity")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js index 2052a57cfdda56699b95b2128780b9be59f5f23c..0c993ccf15530cc96308a47cb03e9283d847a58b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-18.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-18 description: > Array.prototype.indexOf - value of 'fromIndex' is a string containing an exponential number -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, 1, targetObj, 3, 4].indexOf(targetObj, "3E0") === -1 && - [0, 1, 2, targetObj, 4].indexOf(targetObj, "3E0") === 3; - } -runTestCase(testcase); + +assert.sameValue([0, 1, targetObj, 3, 4].indexOf(targetObj, "3E0"), -1, '[0, 1, targetObj, 3, 4].indexOf(targetObj, "3E0")'); +assert.sameValue([0, 1, 2, targetObj, 4].indexOf(targetObj, "3E0"), 3, '[0, 1, 2, targetObj, 4].indexOf(targetObj, "3E0")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js index 32f4295fb2140910f95e06f504fa6b6218e8f65f..ce5382cd40c2b7cf67479dd56e9625971f87104d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-19.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-19 description: > Array.prototype.indexOf - value of 'fromIndex' is a string containing a hex number -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, 1, targetObj, 3, 4].indexOf(targetObj, "0x0003") === -1 && - [0, 1, 2, targetObj, 4].indexOf(targetObj, "0x0003") === 3; - } -runTestCase(testcase); + +assert.sameValue([0, 1, targetObj, 3, 4].indexOf(targetObj, "0x0003"), -1, '[0, 1, targetObj, 3, 4].indexOf(targetObj, "0x0003")'); +assert.sameValue([0, 1, 2, targetObj, 4].indexOf(targetObj, "0x0003"), 3, '[0, 1, 2, targetObj, 4].indexOf(targetObj, "0x0003")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js index 6a2df8a62a5da27a92a8e1bd5e101f8057a16714..c59e64aee010ef0f1cb0f1cd10fd32a7daee490c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-20.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-20 description: > Array.prototype.indexOf - value of 'fromIndex' which is a string containing a number with leading zeros -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, 1, targetObj, 3, 4].indexOf(targetObj, "0003.10") === -1 && - [0, 1, 2, targetObj, 4].indexOf(targetObj, "0003.10") === 3; - } -runTestCase(testcase); + +assert.sameValue([0, 1, targetObj, 3, 4].indexOf(targetObj, "0003.10"), -1, '[0, 1, targetObj, 3, 4].indexOf(targetObj, "0003.10")'); +assert.sameValue([0, 1, 2, targetObj, 4].indexOf(targetObj, "0003.10"), 3, '[0, 1, 2, targetObj, 4].indexOf(targetObj, "0003.10")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js index 2421b75c7069fe04a318517dec4cb02111f2e072..bc7e3e16b4b7d73257541ba87b651bdac265f6c6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-21.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-5-21 description: > Array.prototype.indexOf - value of 'fromIndex' is an Object, which has an own toString method -includes: [runTestCase.js] ---*/ -function testcase() { - // objects inherit the default valueOf() method from Object // that simply returns itself. Since the default valueOf() method // does not return a primitive value, ES next tries to convert the object @@ -22,6 +19,4 @@ function testcase() { } }; - return [0, true].indexOf(true, fromIndex) === 1; - } -runTestCase(testcase); +assert.sameValue([0, true].indexOf(true, fromIndex), 1, '[0, true].indexOf(true, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js index b0c2dad2ab828fa8992839ffa156b5f36af45465..156f138bdef08eddbb9a82410224a7f699b5aa70 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-5-22 description: > Array.prototype.indexOf - value of 'fromIndex' is an Object, which has an own valueOf method -includes: [runTestCase.js] ---*/ -function testcase() { - var fromIndex = { valueOf: function () { return 1; @@ -18,6 +15,4 @@ function testcase() { }; - return [0, true].indexOf(true, fromIndex) === 1; - } -runTestCase(testcase); +assert.sameValue([0, true].indexOf(true, fromIndex), 1, '[0, true].indexOf(true, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js index c0b2435f2ee4aa0eb11120060a617b0622c4d503..220a597ccd6bf50648ab55934dab0c20b203d459 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-23.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - value of 'fromIndex' 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 toStringAccessed = false; var valueOfAccessed = false; @@ -27,6 +24,6 @@ function testcase() { } }; - return [0, true].indexOf(true, fromIndex) === 1 && toStringAccessed && valueOfAccessed; - } -runTestCase(testcase); +assert.sameValue([0, true].indexOf(true, fromIndex), 1, '[0, true].indexOf(true, fromIndex)'); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js index a8a6de899011acc889bf1800106acce5d6f323d8..3d67e8fa869cbd54e42248a2230926b18ce8a540 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf uses inherited valueOf method when value of 'fromIndex' is an object with an own toString and inherited valueOf methods -includes: [runTestCase.js] ---*/ -function testcase() { - var toStringAccessed = false; var valueOfAccessed = false; @@ -31,6 +28,6 @@ function testcase() { return 2; }; - return [0, true].indexOf(true, child) === 1 && valueOfAccessed && !toStringAccessed; - } -runTestCase(testcase); +assert.sameValue([0, true].indexOf(true, child), 1, '[0, true].indexOf(true, child)'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(toStringAccessed, false, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js index f9e377d026ff88b7404bc47c878c2de40b4d5e48..f954ebb6dc67044be3c7cb8bc87d9a9429ac8c1d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-31.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-31 description: > Array.prototype.indexOf - 'fromIndex' is a positive non-integer, verify truncation occurs in the proper direction -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, 2].indexOf(targetObj, 2.5) === -1 && - [0, 1, targetObj].indexOf(targetObj, 2.5) === 2; - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, 2].indexOf(targetObj, 2.5), -1, '[0, targetObj, 2].indexOf(targetObj, 2.5)'); +assert.sameValue([0, 1, targetObj].indexOf(targetObj, 2.5), 2, '[0, 1, targetObj].indexOf(targetObj, 2.5)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js index d8e6dffb449c00c75b4f3804f49cfd39fb553e94..f85ec3fa4dbdd0f160fdd886cdebc2cedc9d10d9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-32.js @@ -6,12 +6,9 @@ es5id: 15.4.4.14-5-32 description: > Array.prototype.indexOf - 'fromIndex' is a negative non-integer, verify truncation occurs in the proper direction -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, 2].indexOf(targetObj, -1.5) === -1 && - [0, 1, targetObj].indexOf(targetObj, -1.5) === 2; - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, 2].indexOf(targetObj, -1.5), -1, '[0, targetObj, 2].indexOf(targetObj, -1.5)'); +assert.sameValue([0, 1, targetObj].indexOf(targetObj, -1.5), 2, '[0, 1, targetObj].indexOf(targetObj, -1.5)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js index 52959b2ed791fa5b1d5d94441bca5fa3dcae6f4b..4d88a35910c70fc98bbb3786dd6e37cff32ef6a3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-6.js @@ -4,14 +4,11 @@ /*--- es5id: 15.4.4.14-5-6 description: Array.prototype.indexOf - 'fromIndex' isn't passed -includes: [runTestCase.js] ---*/ -function testcase() { var arr = [0, 1, 2, 3, 4]; //'fromIndex' will be set as 0 if not passed by default - return arr.indexOf(0) === arr.indexOf(0, 0) && - arr.indexOf(2) === arr.indexOf(2, 0) && - arr.indexOf(4) === arr.indexOf(4, 0); - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf(0), arr.indexOf(0, 0), 'arr.indexOf(0)'); +assert.sameValue(arr.indexOf(2), arr.indexOf(2, 0), 'arr.indexOf(2)'); +assert.sameValue(arr.indexOf(4), arr.indexOf(4, 0), 'arr.indexOf(4)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js index 4dccf39a13b7fd9448991a38061ea40e7b0a33b5..2067ccf0de48f4ad91e45855d1cefbfd7503a301 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-6-1.js @@ -6,15 +6,10 @@ es5id: 15.4.4.14-6-1 description: > Array.prototype.indexOf returns -1 if fromIndex is greater than Array length -includes: [runTestCase.js] ---*/ -function testcase() { var a = [1,2,3]; - if (a.indexOf(1,5) === -1 && - a.indexOf(1,3) === -1 && - [ ].indexOf(1,0) === -1 ){ - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(1,5), -1, 'a.indexOf(1,5)'); +assert.sameValue(a.indexOf(1,3), -1, 'a.indexOf(1,3)'); +assert.sameValue([ ].indexOf(1,0), -1, '[ ].indexOf(1,0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js index 830644b180a0e90b60874ae712e71f6f8be8c0f9..2f4e08177e12cc0d0e15d7c4f88a27ea37f146c6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-1.js @@ -4,17 +4,12 @@ /*--- es5id: 15.4.4.14-8-1 description: Array.prototype.indexOf with negative fromIndex -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,3); - if (a.indexOf(2,-1) === -1 && - a.indexOf(2,-2) === 1 && - a.indexOf(1,-3) === 0 && - a.indexOf(1,-5.3) === 0 ) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(2,-1), -1, 'a.indexOf(2,-1)'); +assert.sameValue(a.indexOf(2,-2), 1, 'a.indexOf(2,-2)'); +assert.sameValue(a.indexOf(1,-3), 0, 'a.indexOf(1,-3)'); +assert.sameValue(a.indexOf(1,-5.3), 0, 'a.indexOf(1,-5.3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js index 0606e2b0c54855d3194cfe9ba91111bd0099d325..8e0e324180814e850c5ba9ca9f4f798d30fcff0a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-11 description: > Array.prototype.indexOf - the length of iteration isn't changed by adding elements to the array during iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [20]; Object.defineProperty(arr, "0", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return arr.indexOf(1) === -1; - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(1), -1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js index cf570d44697030fc6d7eb3fe051945d76ce28633..7f732b5673dc209624db7a4ec8c3e97e8b162ab3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-7.js @@ -4,16 +4,10 @@ /*--- es5id: 15.4.4.14-9-7 description: Array.prototype.indexOf must return correct index (self reference) -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(0,1,2,3); a[2] = a; - if (a.indexOf(a) === 2 && - a.indexOf(3) === 3 ) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(a), 2, 'a.indexOf(a)'); +assert.sameValue(a.indexOf(3), 3, 'a.indexOf(3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js index c35e786e615ec0f0718d7a9f191558bb0e6c09ae..719cbe594cdccef3b0c861d8b14589dfb8e3f87e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-8.js @@ -4,16 +4,10 @@ /*--- es5id: 15.4.4.14-9-8 description: Array.prototype.indexOf must return correct index (Array) -includes: [runTestCase.js] ---*/ -function testcase() { var b = new Array("0,1"); var a = new Array(0,b,"0,1",3); - if (a.indexOf(b.toString()) === 2 && - a.indexOf("0,1") === 2 ) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(b.toString()), 2, 'a.indexOf(b.toString())'); +assert.sameValue(a.indexOf("0,1"), 2, 'a.indexOf("0,1")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js index 18d381fc9e4551ba23f2fa938c584ffd089d0212..276bedd8961d721673de5bafb9fc4d44ba29661d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-9.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.14-9-9 description: Array.prototype.indexOf must return correct index (Sparse Array) -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(0,1); a[4294967294] = 2; // 2^32-2 - is max array element a[4294967295] = 3; // 2^32-1 added as non-array element property @@ -15,9 +13,8 @@ function testcase() { a[4294967297] = 5; // 2^32+1 added as non-array element property // start searching near the end so in case implementation actually tries to test all missing elements!! - return (a.indexOf(2,4294967290 ) === 4294967294 && - a.indexOf(3,4294967290) === -1 && - a.indexOf(4,4294967290) === -1 && - a.indexOf(5,4294967290) === -1 ) ; - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(2,4294967290 ), 4294967294, 'a.indexOf(2,4294967290 )'); +assert.sameValue(a.indexOf(3,4294967290), -1, 'a.indexOf(3,4294967290)'); +assert.sameValue(a.indexOf(4,4294967290), -1, 'a.indexOf(4,4294967290)'); +assert.sameValue(a.indexOf(5,4294967290), -1, 'a.indexOf(5,4294967290)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js index 8e49bb75c357df0b2993a41b9749752c57d81096..f39e91fcd66cd9d3f9f9ddc3d69767fa05deb45a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-1 description: > Array.prototype.indexOf - added properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { }; Object.defineProperty(arr, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return 2 === Array.prototype.indexOf.call(arr, "length"); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(arr, "length"), 2, 'Array.prototype.indexOf.call(arr, "length")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js index a3b208832ace0bf25d3a9bfc7759cda5de78b7d8..eb7d14b7b140882a7648efb33bef192ece011d5d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-11 description: > Array.prototype.indexOf - deleting own property causes index property not to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 2 }; Object.defineProperty(arr, "1", { @@ -28,6 +25,4 @@ function testcase() { configurable: true }); - return -1 === Array.prototype.indexOf.call(arr, 6.99); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(arr, 6.99), -1, 'Array.prototype.indexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js index 2f9ebae04ef952333e1cb7154c860b2e899a8a37..b0cae059a905ab41d00095fdf228d6376fc8f569 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-12 description: > Array.prototype.indexOf - deleting own property causes index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [1, 2]; Object.defineProperty(arr, "1", { @@ -28,6 +25,4 @@ function testcase() { configurable: true }); - return -1 === arr.indexOf("6.99"); - } -runTestCase(testcase); +assert.sameValue(arr.indexOf("6.99"), -1, 'arr.indexOf("6.99")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js index d676d637272f98327470b02a9df41934e6d1f179..1451a026baf82968bd6e468bba548bedd6d5228d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-17 description: > Array.prototype.indexOf - decreasing length of array causes index property not to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2, "last"]; Object.defineProperty(arr, "0", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return -1 === arr.indexOf("last"); - } -runTestCase(testcase); +assert.sameValue(arr.indexOf("last"), -1, 'arr.indexOf("last")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js index ef6d037a15e9615200d83b433c28ea6a369174b6..bc5ed33aae3a15e8fddb18ce6ae245c46ca97823 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - decreasing length of array does not delete non-configurable properties flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2]; Object.defineProperty(arr, "2", { @@ -29,6 +26,5 @@ function testcase() { configurable: true }); - return 2 === arr.indexOf("unconfigurable"); - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf("unconfigurable"), 2, 'arr.indexOf("unconfigurable")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js index 51170421e9759e6199379a63822ee4d536c34fd1..4fd6fed9b385c0cab5e08ab8b5e4bb0fec7a23df 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-2 description: > Array.prototype.indexOf - added properties in step 5 are visible here on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 30 }; var targetObj = function () { }; @@ -21,6 +18,5 @@ function testcase() { } }; - return 4 === Array.prototype.indexOf.call(arr, targetObj, fromIndex); - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(arr, targetObj, fromIndex), 4, 'Array.prototype.indexOf.call(arr, targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js index 5a7e0eb61c135b409de7866901a596da42e33af7..942ea649428a9267a67e72cf50b86dc96da8ec73 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-3 description: > Array.prototype.indexOf - added properties in step 5 are visible here on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; arr.length = 30; var targetObj = function () { }; @@ -22,6 +19,4 @@ function testcase() { } }; - return 4 === arr.indexOf(targetObj, fromIndex); - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(targetObj, fromIndex), 4, 'arr.indexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js index 88b8c81a011578ea21a79da08493e78c6bd3113d..66145acd61a277d8b6dda5f8d6ced048625419c5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-4 description: > Array.prototype.indexOf - deleted properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 2: 6.99 }; Object.defineProperty(arr, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return -1 === Array.prototype.indexOf.call(arr, 6.99); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(arr, 6.99), -1, 'Array.prototype.indexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js index 7589a506957221670078bc46e5bcd9e24b9254d4..f213b2245a2e53d8fe4acc232a6464cd05a53d39 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-5 description: > Array.prototype.indexOf - deleted properties in step 5 are visible here on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 10: false, length: 30 }; var fromIndex = { @@ -20,6 +17,4 @@ function testcase() { } }; - return -1 === Array.prototype.indexOf.call(arr, false, fromIndex); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(arr, false, fromIndex), -1, 'Array.prototype.indexOf.call(arr, false, fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js index 1d5715b2be0913506b7f736892795669590ea170..545e69ff3ade887c44b429279973b5aeedbf3962 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-6 description: > Array.prototype.indexOf - deleted properties in step 5 are visible here on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; arr[10] = "10"; arr.length = 20; @@ -22,6 +19,4 @@ function testcase() { } }; - return -1 === arr.indexOf("10", fromIndex); - } -runTestCase(testcase); +assert.sameValue(arr.indexOf("10", fromIndex), -1, 'arr.indexOf("10", fromIndex)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js index a58f13b5c3cb178a00cb0245d71afe87621f3443..d55c36de69d49b233ab3abcd5ceba7b1a7a2d8f8 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-7 description: > Array.prototype.indexOf - properties added into own object after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 2 }; Object.defineProperty(arr, "0", { @@ -26,6 +23,4 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(arr, 1) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(arr, 1), 1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js index 7333bb2d3729b3d26828bfdc800c1a6fbff903d6..a4bff7b94cd9633c9247a01d23b06663c1f30667 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-8 description: > Array.prototype.indexOf - properties added into own object after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "0", { @@ -26,6 +23,4 @@ function testcase() { configurable: true }); - return arr.indexOf(1) === 1; - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(1), 1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js index 286215eaf9f168909306365f6d30d108631a190e..e857ce6dcba0569c871246d3d6d53f8fcaae8acb 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-1.js @@ -6,13 +6,10 @@ es5id: 15.4.4.14-9-b-i-1 description: > Array.prototype.indexOf - element to be retrieved is own data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 0: 0, 1: 1, 2: 2, length: 3 }; - return Array.prototype.indexOf.call(obj, 0) === 0 && - Array.prototype.indexOf.call(obj, 1) === 1 && - Array.prototype.indexOf.call(obj, 2) === 2; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 1), 1, 'Array.prototype.indexOf.call(obj, 1)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 2), 2, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js index 44326fee24a05262978a47fb8a7299c45543dade..00f007383eacb11d78d81043ae13f19c89458d55 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-10 description: > Array.prototype.indexOf - element to be retrieved is own accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 3 }; Object.defineProperty(obj, "0", { get: function () { @@ -33,8 +30,6 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.indexOf.call(obj, 0) && - 1 === Array.prototype.indexOf.call(obj, 1) && - 2 === Array.prototype.indexOf.call(obj, 2); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 0), 0, 'Array.prototype.indexOf.call(obj, 0)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 1), 1, 'Array.prototype.indexOf.call(obj, 1)'); +assert.sameValue(Array.prototype.indexOf.call(obj, 2), 2, 'Array.prototype.indexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js index b07867069d462deee64bbc4b8d9f9e76748c07e6..eb16f6e6086116fdec4e750bedf3fd062df9962c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-17.js @@ -6,17 +6,12 @@ es5id: 15.4.4.14-9-b-i-17 description: > Array.prototype.indexOf - element to be retrieved is own accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; Object.defineProperty(arr, "0", { set: function () { }, configurable: true }); - return arr.indexOf(undefined) === 0; - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(undefined), 0, 'arr.indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js index ac2fb8d40c70a899aa29c40a7d705cecbf6a2c29..653a7ac03adb62c6d04c9cfad9eba4ba4a8de089 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-18.js @@ -6,17 +6,12 @@ es5id: 15.4.4.14-9-b-i-18 description: > Array.prototype.indexOf - element to be retrieved is own accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 1 }; Object.defineProperty(obj, "0", { set: function () { }, configurable: true }); - return 0 === Array.prototype.indexOf.call(obj, undefined); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, undefined), 0, 'Array.prototype.indexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js index 822b880c152d7f86ea151c4af115355c97c2fd71..8183d3539b2aa95bb9812201ad3ddd299995ec41 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = {}; Object.defineProperty(proto, "0", { get: function () { @@ -31,6 +28,4 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(child, undefined) === 0; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(child, undefined), 0, 'Array.prototype.indexOf.call(child, undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js index bdb0342ee7c562371f88cff2f5a6b0321211a6fd..686925477d7c081308fb3f1eea10928d30d0ef2d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-25.js @@ -7,16 +7,11 @@ description: > Array.prototype.indexOf applied to Arguments object which implements its own property get method (number of arguments is less than number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var func = function (a, b) { return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && -1 === Array.prototype.indexOf.call(arguments, arguments[1]); }; - return func(true); - } -runTestCase(testcase); +assert(func(true), 'func(true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js index eff7d2a6e864eee3f4466f85982c1be2469f3007..aa9c8e3f5de9eba77f1c3a519e94f1f9cb80bf8b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-26.js @@ -7,17 +7,12 @@ description: > Array.prototype.indexOf applied to Arguments object which implements its own property get method (number of arguments equals to number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var func = function (a, b) { return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && 1 === Array.prototype.indexOf.call(arguments, arguments[1]) && -1 === Array.prototype.indexOf.call(arguments, arguments[2]); }; - return func(0, true); - } -runTestCase(testcase); +assert(func(0, true), 'func(0, true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js index 44f3c2937504e6819fe6d7c15cfc98e38e4fce34..b304db2a73f43371f36b3eb5ab7701361bc8ecec 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-27.js @@ -7,17 +7,12 @@ description: > Array.prototype.indexOf applied to Arguments object which implements its own property get method (number of arguments is greater than number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { - var func = function (a, b) { return 0 === Array.prototype.indexOf.call(arguments, arguments[0]) && 3 === Array.prototype.indexOf.call(arguments, arguments[3]) && -1 === Array.prototype.indexOf.call(arguments, arguments[4]); }; - return func(0, false, 0, true); - } -runTestCase(testcase); +assert(func(0, false, 0, true), 'func(0, false, 0, true) !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js index 6d2470aa91bf9dfd0cca81b45f1dfc1a4de1a10c..1c2415e1eb2cf0872abe387c7985a2fefe4f74df 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-28 description: > Array.prototype.indexOf - side-effects are visible in subsequent iterations on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var preIterVisible = false; var arr = []; @@ -33,6 +30,4 @@ function testcase() { configurable: true }); - return arr.indexOf(true) === 1; - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(true), 1, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js index ecaaaca5239c119671d4795102d68ec20efb0fa6..b5ef9b0e51d66d1894852a0c0153da874c9991ab 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-29 description: > Array.prototype.indexOf - side-effects are visible in subsequent iterations on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var preIterVisible = false; var obj = { length: 2 }; @@ -33,6 +30,4 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 1, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js index 1466083190fccb5e5b53d2e50e17c06bfe597a21..6b1a70b5c25cb44f5fd3c4054d527ad8fdf7ec73 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-9 description: > Array.prototype.indexOf - element to be retrieved is own accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [, , , ]; Object.defineProperty(arr, "0", { get: function () { @@ -33,6 +30,6 @@ function testcase() { configurable: true }); - return arr.indexOf(0) === 0 && arr.indexOf(1) === 1 && arr.indexOf(2) === 2; - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(0), 0, 'arr.indexOf(0)'); +assert.sameValue(arr.indexOf(1), 1, 'arr.indexOf(1)'); +assert.sameValue(arr.indexOf(2), 2, 'arr.indexOf(2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js index a6d1a9b5bdc7b1ad1ffe1a405c6e849300898faf..18042eb42f0beed4db8c244bd3a979959b6723b5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-2.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-9-b-iii-2 description: > Array.prototype.indexOf - returns without visiting subsequent element once search value is found -includes: [runTestCase.js] ---*/ -function testcase() { var arr = [1, 2, , 1, 2]; var elementThirdAccessed = false; var elementFifthAccessed = false; @@ -30,6 +28,6 @@ function testcase() { }); arr.indexOf(2); - return !elementThirdAccessed && !elementFifthAccessed; - } -runTestCase(testcase); + +assert.sameValue(elementThirdAccessed, false, 'elementThirdAccessed'); +assert.sameValue(elementFifthAccessed, false, 'elementFifthAccessed');