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 889c353bcb..68068f4525 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 7f42405736..3294781683 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 05a2998206..541896c6f6 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 65385526f4..e3ca3790b6 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 a1e79dd3fb..1157291e5d 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 7cca86643c..4b28849c52 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 06cfe2c7a2..c9d7e1ab9d 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 c9bbd1a6f8..c1a21c1a36 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 07190e6d15..9e365b78ae 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 c84d1fb1b5..c3f0b9aa6b 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 faab872df5..ba0db2af36 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 e1a2404b63..45b2ad893d 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 144ec76973..7de29bc268 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 4e4649ba6b..db7f2dde93 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 0d49b2f827..e5ce782fd1 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 efbc591db0..5d8470f4ee 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 dec55b06b3..41db1ed20a 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 3564c4bfee..fdd7043ec6 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 efc2074243..541996a5d2 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 48efb0e92f..40b169ae14 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 f18cea0082..e06a19566c 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 77de93d98a..67b3bf1ad4 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 67f7c56108..94ab647feb 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 565d2b0518..ce988c07e8 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 6c689093b8..41fd56d6df 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 14d7615c48..06053b3aff 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 3a9e1b7f09..e90d3d9285 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 b7e3f9dc4e..643b4d4e9e 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 64ec99e30c..8d644bbdfe 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 e05bebdecb..f5b7886b08 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 57ecb5d047..e186bf5c1b 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 636f1031df..f4baaa83d5 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 4655af5727..d78900dfdc 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 c9f3a4e400..8f46145d9e 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 0e8b4bc353..a69172fd7e 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 22a0917647..03b9d15e98 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 b8d6fa363d..50507e59e9 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 7cabb1e776..968de40989 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 5d7fc6cf0b..04c758010c 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 b246c532f6..68d426e31a 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 48b98da80f..a2477b8e96 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 085a5a0807..7b16b7668d 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 d14d06a652..473b9cfc71 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 77dcb9ed8b..a0c8b62348 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 a2171ffc04..255b93b6b9 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 2a5e462c71..0e97d0a83c 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 4c7abe56ae..64d6c02837 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 13707d9704..8f98d39e19 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 e15f48ee2f..d63ab41c6c 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 91846b01be..dfc8372b3e 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 ab9f59df66..b48fcc17b6 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 9588ef9afb..f3a850eb82 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 a39ed1b843..0cdf6c64e2 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 e3ea53cee7..d1aa31e7ea 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 51905e6244..455e8690c3 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 820b44c3e9..a507da531f 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 acca7d7d27..a96cde499a 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 f4c8d65ed1..79a8acb8db 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 10cf42c385..299eae0204 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 1da43946be..b066833f1f 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 32162208b0..f418fbd851 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 59fee7a763..6bcf1d59b8 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 f6677bce7b..27d0d463bc 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 88d90a0ae9..cbd2f0b275 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 c6228091e4..e838aa1710 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 2052a57cfd..0c993ccf15 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 32f4295fb2..ce5382cd40 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 6a2df8a62a..c59e64aee0 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 2421b75c70..bc7e3e16b4 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 b0c2dad2ab..156f138bde 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 c0b2435f2e..220a597ccd 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 a8a6de8990..3d67e8fa86 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 f9e377d026..f954ebb6dc 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 d8e6dffb44..f85ec3fa4d 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 52959b2ed7..4d88a35910 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 4dccf39a13..2067ccf0de 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 830644b180..2f4e08177e 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 0606e2b0c5..8e0e324180 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 cf570d4469..7f732b5673 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 c35e786e61..719cbe594c 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 18d381fc9e..276bedd896 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 8e49bb75c3..f39e91fcd6 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 a3b208832a..eb7d14b7b1 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 2f9ebae04e..b0cae059a9 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 d676d63727..1451a026ba 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 ef6d037a15..bc5ed33aae 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 51170421e9..4fd6fed9b3 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 5a7e0eb61c..942ea64942 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 88b8c81a01..66145acd61 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 7589a50695..f213b2245a 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 1d5715b2be..545e69ff3a 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 a58f13b5c3..d55c36de69 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 7333bb2d37..a4bff7b94c 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 286215eaf9..e857ce6dcb 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 44326fee24..00f007383e 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 b07867069d..eb16f6e608 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 ac2fb8d40c..653a7ac03a 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 822b880c15..8183d3539b 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 bdb0342ee7..686925477d 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 eff7d2a6e8..aa9c8e3f5d 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 44f3c29375..b304db2a73 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 6d2470aa91..1c2415e1eb 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 ecaaaca523..b5ef9b0e51 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 1466083190..6b1a70b5c2 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 a6d1a9b5bd..18042eb42f 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');