From 354b7cc11b789cb6ad7d30ec7a311f031ca9f2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:17:18 +0200 Subject: [PATCH] Replace runTestCase with assert helpers [test/built-ins/Array/prototype/lastIndexOf] --- .../Array/prototype/lastIndexOf/15.4.4.15-0-1.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-0-2.js | 8 +------- .../Array/prototype/lastIndexOf/15.4.4.15-1-11.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-1-12.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-1-14.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-1-15.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-1-4.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-1-6.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-1-8.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-1-9.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-2-1.js | 8 ++------ .../Array/prototype/lastIndexOf/15.4.4.15-2-10.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-2-11.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-2-13.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-2-14.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-2-17.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-2-19.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-2-3.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-2-5.js | 6 +----- .../Array/prototype/lastIndexOf/15.4.4.15-2-6.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-2-7.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-2-8.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-2-9.js | 6 +----- .../Array/prototype/lastIndexOf/15.4.4.15-3-1.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-3-10.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-3-11.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-12.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-13.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-14.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-3-15.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-16.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-17.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-18.js | 6 +----- .../Array/prototype/lastIndexOf/15.4.4.15-3-19.js | 12 +++--------- .../Array/prototype/lastIndexOf/15.4.4.15-3-2.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-3-20.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-21.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-3-23.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-3-24.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-25.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-3.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-3-4.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-3-5.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-3-6.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-7.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-3-9.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-4-1.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-4-10.js | 7 ++----- .../Array/prototype/lastIndexOf/15.4.4.15-4-11.js | 7 ++----- .../Array/prototype/lastIndexOf/15.4.4.15-4-2.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-4-3.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-4-4.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-4-5.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-4-6.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-4-7.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-4-8.js | 11 ++--------- .../Array/prototype/lastIndexOf/15.4.4.15-4-9.js | 7 ++----- .../Array/prototype/lastIndexOf/15.4.4.15-5-10.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-11.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-12.js | 7 ++----- .../Array/prototype/lastIndexOf/15.4.4.15-5-16.js | 7 ++----- .../Array/prototype/lastIndexOf/15.4.4.15-5-18.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-19.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-20.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-21.js | 9 ++------- .../Array/prototype/lastIndexOf/15.4.4.15-5-22.js | 10 +++------- .../Array/prototype/lastIndexOf/15.4.4.15-5-23.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-25.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-31.js | 9 +++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-32.js | 8 ++------ .../Array/prototype/lastIndexOf/15.4.4.15-5-6.js | 11 ++++------- .../Array/prototype/lastIndexOf/15.4.4.15-6-1.js | 11 +++-------- .../Array/prototype/lastIndexOf/15.4.4.15-7-1.js | 13 ++++--------- .../Array/prototype/lastIndexOf/15.4.4.15-8-11.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-3.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-8-4.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-8-5.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-8-6.js | 10 ++-------- .../Array/prototype/lastIndexOf/15.4.4.15-8-7.js | 12 +++--------- .../Array/prototype/lastIndexOf/15.4.4.15-8-8.js | 12 +++--------- .../Array/prototype/lastIndexOf/15.4.4.15-8-9.js | 12 ++++-------- .../Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js | 8 ++------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js | 7 +------ .../Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-1.js | 11 +++-------- .../prototype/lastIndexOf/15.4.4.15-8-b-i-10.js | 11 +++-------- .../prototype/lastIndexOf/15.4.4.15-8-b-i-17.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-18.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-25.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-26.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-28.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-29.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-9.js | 9 +++------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js | 8 ++------ .../prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js | 8 +++----- .../Array/prototype/lastIndexOf/15.4.4.15-9-2.js | 10 +++------- 105 files changed, 194 insertions(+), 684 deletions(-) diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js index 0fdbe89500..2ab710995f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.15-0-1 description: Array.prototype.lastIndexOf must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Array.prototype.lastIndexOf; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js index de1db48d15..3cda6dac6a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.4.4.15-0-2 description: Array.prototype.lastIndexOf has a length property whose value is 1. -includes: [runTestCase.js] ---*/ -function testcase() { - if (Array.prototype.lastIndexOf.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.length, 1, 'Array.prototype.lastIndexOf.length'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js index 2c4b696d3c..c8d087596e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-11.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.15-1-11 description: Array.prototype.lastIndexOf applied to Date object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new Date(); obj.length = 2; obj[1] = true; - return Array.prototype.lastIndexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js index 36c1383e6c..5047d5fd0d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-12.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.15-1-12 description: Array.prototype.lastIndexOf applied to RegExp object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new RegExp("afdasf"); obj.length = 100; obj[1] = "afdasf"; - return Array.prototype.lastIndexOf.call(obj, "afdasf") === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, "afdasf"), 1, 'Array.prototype.lastIndexOf.call(obj, "afdasf")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js index e7f60ebe67..cc0ca6c7c4 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-14.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.15-1-14 description: Array.prototype.lastIndexOf applied to Error object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new SyntaxError(); obj.length = 2; obj[1] = Infinity; - return Array.prototype.lastIndexOf.call(obj, Infinity) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, Infinity), 1, 'Array.prototype.lastIndexOf.call(obj, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js index 3d6f5ab4b1..8ea1456bbd 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-15.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.15-1-15 description: Array.prototype.lastIndexOf applied to the Arguments object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = (function fun() { return arguments; }(1, 2, 3)); - return Array.prototype.lastIndexOf.call(obj, 2) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), 1, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js index 9e1bd0f062..ae93a2bb42 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-4.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.15-1-4 description: Array.prototype.lastIndexOf applied to Boolean object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new Boolean(false); obj.length = 2; obj[1] = true; - return Array.prototype.lastIndexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js index ea9a30d2ee..e7b7d2a3d5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-6.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.15-1-6 description: Array.prototype.lastIndexOf applied to Number object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new Number(-3); obj.length = 2; obj[1] = true; - return Array.prototype.lastIndexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js index 558fdb375d..f91c8cf876 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-8.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.15-1-8 description: Array.prototype.lastIndexOf applied to String object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = new String("undefined"); - return Array.prototype.lastIndexOf.call(obj, "f") === 4; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, "f"), 4, 'Array.prototype.lastIndexOf.call(obj, "f")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js index f36ce31b0c..c50766f0eb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-9.js @@ -4,16 +4,11 @@ /*--- es5id: 15.4.4.15-1-9 description: Array.prototype.lastIndexOf applied to Function object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = function (a, b) { return a + b; }; obj[1] = true; - return Array.prototype.lastIndexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js index cde991369b..f7add9e98b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-1.js @@ -6,13 +6,9 @@ es5id: 15.4.4.15-2-1 description: > Array.prototype.lastIndexOf - 'length' is own data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 1: null, 2: undefined, length: 2 }; - return Array.prototype.lastIndexOf.call(obj, null) === 1 && - Array.prototype.lastIndexOf.call(obj, undefined) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, null), 1, 'Array.prototype.lastIndexOf.call(obj, null)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), -1, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js index ec8c487dc3..4666c52eb7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-2-10 description: > Array.prototype.lastIndexOf - 'length' is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = {}; Object.defineProperty(proto, "length", { get: function () { @@ -26,7 +23,5 @@ function testcase() { child[1] = 1; child[2] = 2; - return Array.prototype.lastIndexOf.call(child, 1) === 1 && - Array.prototype.lastIndexOf.call(child, 2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(child, 1), 1, 'Array.prototype.lastIndexOf.call(child, 1)'); +assert.sameValue(Array.prototype.lastIndexOf.call(child, 2), -1, 'Array.prototype.lastIndexOf.call(child, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js index 1e1ba93358..55db980940 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-11.js @@ -6,17 +6,12 @@ es5id: 15.4.4.15-2-11 description: > Array.prototype.lastIndexOf - 'length' is own accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 1 }; Object.defineProperty(obj, "length", { set: function () { }, configurable: true }); - return Array.prototype.lastIndexOf.call(obj, 1) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js index baaee5fb43..d3d019c2b3 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-2-13 description: > Array.prototype.lastIndexOf - 'length' is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = {}; Object.defineProperty(proto, "length", { set: function () { }, @@ -23,6 +20,4 @@ function testcase() { var child = new Con(); child[0] = true; - return Array.prototype.lastIndexOf.call(child, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(child, true), -1, 'Array.prototype.lastIndexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js index 52355805ba..8a4b1321eb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-14.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-2-14 description: > Array.prototype.lastIndexOf - 'length' is undefined property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: null, 1: undefined }; - return Array.prototype.lastIndexOf.call(obj, null) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, null), -1, 'Array.prototype.lastIndexOf.call(obj, null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js index fce78d55c6..759a0b87b6 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-2-17 description: > Array.prototype.lastIndexOf applied to Arguments object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = function () { }; var func = function (a, b) { arguments[2] = function () { }; @@ -18,6 +15,4 @@ function testcase() { Array.prototype.lastIndexOf.call(arguments, arguments[2]) === -1; }; - return func(0, targetObj); - } -runTestCase(testcase); +assert(func(0, targetObj), 'func(0, targetObj) !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js index 7dceed03e8..e34648908b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-19.js @@ -6,18 +6,13 @@ es5id: 15.4.4.15-2-19 description: > Array.prototype.lastIndexOf applied to String 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.lastIndexOf.call(obj, obj[1]) === 1 && - Array.prototype.lastIndexOf.call(obj, obj[2]) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, obj[1]), 1, 'Array.prototype.lastIndexOf.call(obj, obj[1])'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, obj[2]), -1, 'Array.prototype.lastIndexOf.call(obj, obj[2])'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js index 4ad48bbf23..a89823fe84 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-2-3 description: > Array.prototype.lastIndexOf - '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] = child; - return Array.prototype.lastIndexOf.call(child, child) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(child, child), 1, 'Array.prototype.lastIndexOf.call(child, child)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js index 3f6fe30d80..ec65672e09 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-5.js @@ -6,10 +6,8 @@ es5id: 15.4.4.15-2-5 description: > Array.prototype.lastIndexOf - '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] = null; - return Array.prototype.lastIndexOf.call(child, null) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(child, null), 1, 'Array.prototype.lastIndexOf.call(child, null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js index 1299841e4a..b62956bda8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-2-6 description: > Array.prototype.lastIndexOf - 'length' is an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = { length: 2 }; var Con = function () {}; @@ -20,7 +17,5 @@ function testcase() { child[1] = "x"; child[2] = "y"; - return Array.prototype.lastIndexOf.call(child, "x") === 1 && - Array.prototype.lastIndexOf.call(child, "y") === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(child, "x"), 1, 'Array.prototype.lastIndexOf.call(child, "x")'); +assert.sameValue(Array.prototype.lastIndexOf.call(child, "y"), -1, 'Array.prototype.lastIndexOf.call(child, "y")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js index 8024d8db03..ae42d88b7b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-2-7 description: > Array.prototype.lastIndexOf - 'length' is own accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: true, 2: false }; Object.defineProperty(obj, "length", { @@ -20,7 +17,5 @@ function testcase() { configurable: true }); - return Array.prototype.lastIndexOf.call(obj, true) === 1 && - Array.prototype.lastIndexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js index 13a925e6a9..034d6e82d7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-2-8 description: > Array.prototype.lastIndexOf - 'length' is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = { length: 0 }; var Con = function () {}; @@ -26,6 +23,4 @@ function testcase() { configurable: true }); - return Array.prototype.lastIndexOf.call(child, eval) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(child, eval), 1, 'Array.prototype.lastIndexOf.call(child, eval)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js index ea1998bb99..0532ead5fc 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-9.js @@ -7,10 +7,8 @@ description: > Array.prototype.lastIndexOf - 'length' is own accessor 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 () { @@ -32,6 +30,4 @@ function testcase() { configurable: true }); - return Array.prototype.lastIndexOf.call(child, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(child, true), 1, 'Array.prototype.lastIndexOf.call(child, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js index 92063ff838..50942bbe45 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.4.4.15-3-1 description: Array.prototype.lastIndexOf - value of 'length' is undefined -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 1, 1: 1, length: undefined }; - return Array.prototype.lastIndexOf.call(obj, 1) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js index 523b79577e..f07ce995f5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-10.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-3-10 description: > Array.prototype.lastIndexOf - value of 'length' is a number (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 0, length: NaN }; - return Array.prototype.lastIndexOf.call(obj, 0) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), -1, 'Array.prototype.lastIndexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js index 5c8648f770..1a7360b2b9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-11.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-11 description: > Array.prototype.lastIndexOf - value of 'length' is a string containing positive number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {1: true, 2: false, length: "2"}; - return Array.prototype.lastIndexOf.call(obj, true) === 1 && - Array.prototype.lastIndexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js index 1288d30243..f48622efef 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-12.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-12 description: > Array.prototype.lastIndexOf - value of 'length' is a string containing negative number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {1: null, 2: undefined, length: "-4294967294"}; - return Array.prototype.lastIndexOf.call(obj, null) === -1 && - Array.prototype.lastIndexOf.call(obj, undefined) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, null), -1, 'Array.prototype.lastIndexOf.call(obj, null)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), -1, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js index 13902394b6..038bb63eda 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-13.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-13 description: > Array.prototype.lastIndexOf - value of 'length' is a string containing a decimal number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 4: 4, 5: 5, length: "5.512345" }; - return Array.prototype.lastIndexOf.call(obj, 4) === 4 && - Array.prototype.lastIndexOf.call(obj, 5) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 4), 4, 'Array.prototype.lastIndexOf.call(obj, 4)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 5), -1, 'Array.prototype.lastIndexOf.call(obj, 5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js index 316aa3844e..3eb3a8c25d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-14.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-3-14 description: > Array.prototype.lastIndexOf - value of 'length' is a string containing -Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - var objThree = { 0: true, 1: true, length: "-Infinity" }; - return Array.prototype.lastIndexOf.call(objThree, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(objThree, true), -1, 'Array.prototype.lastIndexOf.call(objThree, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js index d1021b5c96..e067aeac52 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-15.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-15 description: > Array.prototype.lastIndexOf - value of 'length' is a string containing an exponential number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {229: 229, 230: 2.3E2, length: "2.3E2"}; - return Array.prototype.lastIndexOf.call(obj, 229) === 229 && - Array.prototype.lastIndexOf.call(obj, 2.3E2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 229), 229, 'Array.prototype.lastIndexOf.call(obj, 229)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2.3E2), -1, 'Array.prototype.lastIndexOf.call(obj, 2.3E2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js index af3b8fab2e..334004e207 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-16.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-16 description: > Array.prototype.lastIndexOf - value of 'length' is a string which is able to be converted into hex number -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 2573: 2573, 2574: 0x000A0E, length: "0x000A0E" }; - return Array.prototype.lastIndexOf.call(obj, 2573) === 2573 && - Array.prototype.lastIndexOf.call(obj, 0x000A0E) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2573), 2573, 'Array.prototype.lastIndexOf.call(obj, 2573)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0x000A0E), -1, 'Array.prototype.lastIndexOf.call(obj, 0x000A0E)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js index f4957e7a21..3c855c3a1d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-17.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-17 description: > Array.prototype.lastIndexOf - value of 'length' is a string containing a number with leading zeros -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: 1, 2: 2, length: "0002.0" }; - return Array.prototype.lastIndexOf.call(obj, 1) === 1 && - Array.prototype.lastIndexOf.call(obj, 2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), 1, 'Array.prototype.lastIndexOf.call(obj, 1)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), -1, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js index 64805a4425..bdec51c07d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-18.js @@ -6,13 +6,9 @@ es5id: 15.4.4.15-3-18 description: > Array.prototype.lastIndexOf - value of 'length' is a string that can't convert to a number -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = new String("123abc123"); var obj = { 0: targetObj, length: "123abc123" }; - return Array.prototype.lastIndexOf.call(obj, targetObj) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js index ade1804a98..9999575a4f 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-19.js @@ -6,13 +6,9 @@ es5id: 15.4.4.15-3-19 description: > Array.prototype.lastIndexOf - value of 'length' is an Object which has an own toString method -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.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 @@ -31,7 +27,5 @@ function testcase() { } }; - return Array.prototype.lastIndexOf.call(obj, targetObj) === 1 && - Array.prototype.lastIndexOf.call(obj, 2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), 1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), -1, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js index 20644243b5..06e7cefa39 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-2.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-3-2 description: > Array.prototype.lastIndexOf return -1 when value of 'length' is a boolean (value is true) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { 0: 0, 1: 1, length: true }; - return Array.prototype.lastIndexOf.call(obj, 0) === 0 && - Array.prototype.lastIndexOf.call(obj, 1) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), 0, 'Array.prototype.lastIndexOf.call(obj, 0)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js index ab523b94c3..7f8ef955f4 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-3-20 description: > Array.prototype.lastIndexOf - 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, @@ -23,7 +20,5 @@ function testcase() { } }; - return Array.prototype.lastIndexOf.call(obj, true) === 1 && - Array.prototype.lastIndexOf.call(obj, 2) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), -1, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js index 74e6ff5219..62cf4d1255 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-21.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - '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; @@ -31,6 +28,6 @@ function testcase() { } }; - return Array.prototype.lastIndexOf.call(obj, targetObj) === 1 && toStringAccessed && valueOfAccessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), 1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js index ffb3721cf3..5a768ba622 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-23.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf uses inherited valueOf method when 'length' is an object with an own toString and an 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.lastIndexOf.call(obj, child) === 1 && valueOfAccessed && !toStringAccessed; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, child), 1, 'Array.prototype.lastIndexOf.call(obj, child)'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(toStringAccessed, false, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js index b0e5d4b2fd..7be5d3ae1d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-24.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-24 description: > Array.prototype.lastIndexOf - 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.5 }; - return Array.prototype.lastIndexOf.call(obj, true) === 122 && - Array.prototype.lastIndexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 122, 'Array.prototype.lastIndexOf.call(obj, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js index 3334882165..e7b10e7263 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-25.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-25 description: > Array.prototype.lastIndexOf - value of 'length' is a negative non-integer -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: true, 2: false, length: -4294967294.5 }; - return Array.prototype.lastIndexOf.call(obj, true) === -1 && - Array.prototype.lastIndexOf.call(obj, false) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), -1, 'Array.prototype.lastIndexOf.call(obj, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, false), -1, 'Array.prototype.lastIndexOf.call(obj, false)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js index de8c910483..008b7f7727 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-3.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-3-3 description: > Array.prototype.lastIndexOf - value of 'length' is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: "undefined", length: 0 }; - return Array.prototype.lastIndexOf.call(obj, "undefined") === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, "undefined"), -1, 'Array.prototype.lastIndexOf.call(obj, "undefined")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js index 066e9be973..e40befa623 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-4.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-3-4 description: > Array.prototype.lastIndexOf - value of 'length' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: true, length: -0 }; - return Array.prototype.lastIndexOf.call(obj, true) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), -1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js index 2d493e086b..d5ca9992fe 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-5.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-3-5 description: > Array.prototype.lastIndexOf - value of 'length' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: +0, length: +0 }; - return Array.prototype.lastIndexOf.call(obj, +0) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, +0), -1, 'Array.prototype.lastIndexOf.call(obj, +0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js index 1bc97cbb8b..915fa20021 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-6.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-6 description: > Array.prototype.lastIndexOf - value of 'length' is a number (value is a positive number) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 99: true, 100: 100, length: 100 }; - return Array.prototype.lastIndexOf.call(obj, true) === 99 && - Array.prototype.lastIndexOf.call(obj, 100) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 99, 'Array.prototype.lastIndexOf.call(obj, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 100), -1, 'Array.prototype.lastIndexOf.call(obj, 100)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js index b78b385d77..e82434d410 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-7.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-3-7 description: > Array.prototype.lastIndexOf - value of 'length' is a number (value is a negative number) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 4: -Infinity, 5: Infinity, length: 5 - Math.pow(2, 32) }; - return Array.prototype.lastIndexOf.call(obj, -Infinity) === -1 && - Array.prototype.lastIndexOf.call(obj, Infinity) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, -Infinity), -1, 'Array.prototype.lastIndexOf.call(obj, -Infinity)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, Infinity), -1, 'Array.prototype.lastIndexOf.call(obj, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js index 3dd1c28950..b0af5fb9e8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-9.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-3-9 description: > Array.prototype.lastIndexOf - value of 'length' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 0, length: -Infinity }; - return Array.prototype.lastIndexOf.call(obj, 0) === -1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), -1, 'Array.prototype.lastIndexOf.call(obj, 0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js index dcf7a58f0b..4095313c80 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-1.js @@ -6,13 +6,8 @@ es5id: 15.4.4.15-4-1 description: > Array.prototype.lastIndexOf returns -1 if 'length' is 0 (empty array) -includes: [runTestCase.js] ---*/ -function testcase() { var i = [].lastIndexOf(42); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js index 82d5899218..d2dc602e35 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-10.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.15-4-10 description: Array.prototype.lastIndexOf - '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.lastIndexOf.call(obj, targetObj) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js index 094aac5d6f..db08a1bdf0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-11.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.15-4-11 description: Array.prototype.lastIndexOf - 'length' is an empty string -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = []; var obj = { 0: targetObj, 100: targetObj, length: "" }; - return Array.prototype.lastIndexOf.call(obj, targetObj) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js index d8ffff3cab..e0b02ffa77 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-2.js @@ -6,15 +6,9 @@ es5id: 15.4.4.15-4-2 description: > Array.prototype.lastIndexOf returns -1 if 'length' is 0 ( length overridden to null (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.lastIndexOf.call({length: null}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js index ef750bd33c..144e49533b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-3.js @@ -6,15 +6,9 @@ es5id: 15.4.4.15-4-3 description: > Array.prototype.lastIndexOf returns -1 if 'length' is 0 (length overridden to false (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.lastIndexOf.call({length: false}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js index ff33065476..41da0f5a07 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-4.js @@ -6,10 +6,8 @@ es5id: 15.4.4.15-4-4 description: > Array.prototype.lastIndexOf returns -1 if 'length' is 0 (generic 'array' with length 0 ) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -17,8 +15,5 @@ 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/lastIndexOf/15.4.4.15-4-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-5.js index ed91858c43..36d926ba6a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-5.js @@ -6,15 +6,9 @@ es5id: 15.4.4.15-4-5 description: > Array.prototype.lastIndexOf returns -1 if 'length' is 0 ( length overridden to '0' (type conversion)) -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/lastIndexOf/15.4.4.15-4-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-6.js index e0c041282c..14e452b50a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-6.js @@ -6,15 +6,9 @@ es5id: 15.4.4.15-4-6 description: > Array.prototype.lastIndexOf returns -1 if 'length' is 0 (subclassed Array, length overridden with obj with valueOf) -includes: [runTestCase.js] ---*/ -function testcase() { - var i = Array.prototype.lastIndexOf.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/lastIndexOf/15.4.4.15-4-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-7.js index 7e18aa2727..0d719af97b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.15-4-7 description: > Array.prototype.lastIndexOf returns -1 if 'length' is 0 ( length is object overridden with obj w/o valueOf (toString)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -24,8 +22,5 @@ function testcase() { // resulting string to a number. var i = Array.prototype.lastIndexOf.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/lastIndexOf/15.4.4.15-4-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-8.js index b8f48409a7..1fffacd0fa 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-8.js @@ -6,12 +6,8 @@ es5id: 15.4.4.15-4-8 description: > Array.prototype.lastIndexOf 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.lastIndexOf.call({length: [ ]}, 1); - if (i === -1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js index 9b2d972ca1..62e4e34c7b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-4-9.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.15-4-9 description: Array.prototype.lastIndexOf - '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.lastIndexOf.call(obj, targetObj) === -1; - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), -1, 'Array.prototype.lastIndexOf.call(obj, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js index 951360afe4..417a0365b2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-10.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-10 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is positive number) -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, true].lastIndexOf(targetObj, 1.5) === 1 && - [0, true, targetObj].lastIndexOf(targetObj, 1.5) === -1; - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, 1.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, 1.5)'); +assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, 1.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, 1.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js index d1bc4a0654..df9d705d64 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-11.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-11 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is negative number) -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, true].lastIndexOf(targetObj, -2.5) === 1 && - [0, true, targetObj].lastIndexOf(targetObj, -2.5) === -1; - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, -2.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, -2.5)'); +assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, -2.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, -2.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js index 9e713cc1d2..64fac83f29 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-12.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-12 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { var arr = []; arr[Math.pow(2, 32) - 2] = null; // length is the max value of Uint type - return arr.lastIndexOf(null, Infinity) === (Math.pow(2, 32) - 2); - } -runTestCase(testcase); + +assert.sameValue(arr.lastIndexOf(null, Infinity), Math.pow(2, 32) - 2, 'arr.lastIndexOf(null, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js index dd885431a7..65c32cf5c5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-16.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-16 description: > Array.prototype.lastIndexOf - 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.lastIndexOf(true, "Infinity") === (Math.pow(2, 32) - 2); - } -runTestCase(testcase); + +assert.sameValue(arr.lastIndexOf(true, "Infinity"), Math.pow(2, 32) - 2, 'arr.lastIndexOf(true, "Infinity")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js index e4c315c211..67cb3acf27 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-18.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-18 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing an exponential number -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, NaN, targetObj, 3, false].lastIndexOf(targetObj, "2E0") === 2 && - [0, NaN, 3, targetObj, false].lastIndexOf(targetObj, "2E0") === -1; - } -runTestCase(testcase); + +assert.sameValue([0, NaN, targetObj, 3, false].lastIndexOf(targetObj, "2E0"), 2, '[0, NaN, targetObj, 3, false].lastIndexOf(targetObj, "2E0")'); +assert.sameValue([0, NaN, 3, targetObj, false].lastIndexOf(targetObj, "2E0"), -1, '[0, NaN, 3, targetObj, false].lastIndexOf(targetObj, "2E0")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js index 4d731b69e7..20e8ae5235 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-19.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-19 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing a hex number -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, true, targetObj, 3, false].lastIndexOf(targetObj, "0x0002") === 2 && - [0, true, 3, targetObj, false].lastIndexOf(targetObj, "0x0002") === -1; - } -runTestCase(testcase); + +assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, "0x0002"), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, "0x0002")'); +assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, "0x0002"), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, "0x0002")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js index b1bd4d7d74..fa30923734 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-20.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-20 description: > Array.prototype.lastIndexOf - value of 'fromIndex' which is a string containing a number with leading zeros -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10") === 2 && - [0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10") === -1; - } -runTestCase(testcase); + +assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10"), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, "0002.10")'); +assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10"), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, "0002.10")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js index 29efc1789c..34c98e7af2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-21.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-5-21 description: > Array.prototype.lastIndexOf - value of 'fromIndex' which is an Object, and 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 @@ -23,7 +20,5 @@ function testcase() { }; var targetObj = new RegExp(); - return [0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex) === 2 && - [0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex) === -1; - } -runTestCase(testcase); +assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex)'); +assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js index f5108e1f6d..5783177f72 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-5-22 description: > Array.prototype.lastIndexOf - value of 'fromIndex' which is an object, and has an own valueOf method -includes: [runTestCase.js] ---*/ -function testcase() { - var fromIndex = { valueOf: function () { return 2; @@ -18,7 +15,6 @@ function testcase() { }; var targetObj = function () {}; - return [0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex) === 2 && - [0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex) === -1; - } -runTestCase(testcase); + +assert.sameValue([0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex), 2, '[0, true, targetObj, 3, false].lastIndexOf(targetObj, fromIndex)'); +assert.sameValue([0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex), -1, '[0, true, 3, targetObj, false].lastIndexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js index d7e89581cf..fb323cbcbb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-23.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - 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].lastIndexOf(true, fromIndex) === 1 && toStringAccessed && valueOfAccessed; - } -runTestCase(testcase); +assert.sameValue([0, true].lastIndexOf(true, fromIndex), 1, '[0, true].lastIndexOf(true, fromIndex)'); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js index f3c4f64ca4..b025aae8f0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf use 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 1; }; - return [0, true].lastIndexOf(true, child) === 1 && valueOfAccessed && !toStringAccessed; - } -runTestCase(testcase); +assert.sameValue([0, true].lastIndexOf(true, child), 1, '[0, true].lastIndexOf(true, child)'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert.sameValue(toStringAccessed, false, 'toStringAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js index 94359f1ce2..a2e746148c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-31.js @@ -6,12 +6,9 @@ es5id: 15.4.4.15-5-31 description: > Array.prototype.lastIndexOf - 'fromIndex' is a positive non-integer, verify truncation occurs in the proper direction -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, true].lastIndexOf(targetObj, 1.5) === 1 && - [0, true, targetObj].lastIndexOf(targetObj, 1.5) === -1; - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, 1.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, 1.5)'); +assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, 1.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, 1.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js index 310b69d652..62052efbe7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-32.js @@ -6,13 +6,9 @@ es5id: 15.4.4.15-5-32 description: > Array.prototype.lastIndexOf - 'fromIndex' is a negative non-integer, verify truncation occurs in the proper direction -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - return [0, targetObj, true].lastIndexOf(targetObj, -2.5) === 1 && - [0, true, targetObj].lastIndexOf(targetObj, -2.5) === -1; - } -runTestCase(testcase); +assert.sameValue([0, targetObj, true].lastIndexOf(targetObj, -2.5), 1, '[0, targetObj, true].lastIndexOf(targetObj, -2.5)'); +assert.sameValue([0, true, targetObj].lastIndexOf(targetObj, -2.5), -1, '[0, true, targetObj].lastIndexOf(targetObj, -2.5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js index fdc15ac1c3..24ff075519 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-6.js @@ -4,14 +4,11 @@ /*--- es5id: 15.4.4.15-5-6 description: Array.prototype.lastIndexOf when 'fromIndex' isn't passed -includes: [runTestCase.js] ---*/ -function testcase() { var arr = [0, 1, 2, 3, 4]; //'fromIndex' will be set as 4 if not passed by default - return arr.lastIndexOf(0) === arr.lastIndexOf(0, 4) && - arr.lastIndexOf(2) === arr.lastIndexOf(2, 4) && - arr.lastIndexOf(4) === arr.lastIndexOf(4, 4); - } -runTestCase(testcase); + +assert.sameValue(arr.lastIndexOf(0), arr.lastIndexOf(0, 4), 'arr.lastIndexOf(0)'); +assert.sameValue(arr.lastIndexOf(2), arr.lastIndexOf(2, 4), 'arr.lastIndexOf(2)'); +assert.sameValue(arr.lastIndexOf(4), arr.lastIndexOf(4, 4), 'arr.lastIndexOf(4)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js index acd7d1d5a6..89811caf37 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-1.js @@ -6,14 +6,9 @@ es5id: 15.4.4.15-6-1 description: > Array.prototype.lastIndexOf when fromIndex greater than Array.length -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,3); - if (a.lastIndexOf(3,5.4) === 2 && - a.lastIndexOf(3,3.1) === 2 ) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(3,5.4), 2, 'a.lastIndexOf(3,5.4)'); +assert.sameValue(a.lastIndexOf(3,3.1), 2, 'a.lastIndexOf(3,3.1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js index 977f2397e2..288516f3c8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.4.4.15-7-1 description: Array.prototype.lastIndexOf with negative fromIndex -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,3); - if (a.lastIndexOf(2,-2) === 1 && - a.lastIndexOf(2,-3) === -1 && - a.lastIndexOf(1,-5.3) === -1 ) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(2,-2), 1, 'a.lastIndexOf(2,-2)'); +assert.sameValue(a.lastIndexOf(2,-3), -1, 'a.lastIndexOf(2,-3)'); +assert.sameValue(a.lastIndexOf(1,-5.3), -1, 'a.lastIndexOf(1,-5.3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js index 640c177015..dd28cbc65b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-11 description: > Array.prototype.lastIndexOf - 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.lastIndexOf(1) === -1; - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(1), -1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js index 47048b5347..6f8847b9be 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-3.js @@ -4,16 +4,10 @@ /*--- es5id: 15.4.4.15-8-3 description: Array.prototype.lastIndexOf must return correct index(string) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return "false"}}; var szFalse = "false"; var a = new Array(szFalse, "false","false1",undefined,0,false,null,1,obj,0); - if (a.lastIndexOf("false") === 1) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf("false"), 1, 'a.lastIndexOf("false")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js index a70f426aee..06ee8325bf 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-4.js @@ -4,17 +4,11 @@ /*--- es5id: 15.4.4.15-8-4 description: Array.prototype.lastIndexOf must return correct index(undefined) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return undefined;}}; var _undefined1 = undefined; var _undefined2; var a = new Array(_undefined1,_undefined2,undefined,true,0,false,null,1,"undefined",obj,1); - if (a.lastIndexOf(undefined) === 2) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(undefined), 2, 'a.lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js index 2d9f5864fe..31db157916 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-5.js @@ -4,17 +4,11 @@ /*--- es5id: 15.4.4.15-8-5 description: Array.prototype.lastIndexOf must return correct index(Object) -includes: [runTestCase.js] ---*/ -function testcase() { var obj1 = {toString:function (){return "false"}}; var obj2 = {toString:function (){return "false"}}; var obj3 = obj1; var a = new Array(obj2,obj1,obj3,false,undefined,0,false,null,{toString:function (){return "false"}},"false"); - if (a.lastIndexOf(obj3) === 2) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(obj3), 2, 'a.lastIndexOf(obj3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js index efd470b2ca..3bbb963344 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-6.js @@ -4,16 +4,10 @@ /*--- es5id: 15.4.4.15-8-6 description: Array.prototype.lastIndexOf must return correct index(null) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return null}}; var _null = null; var a = new Array(true,undefined,0,false,null,1,"str",0,1,null,true,false,undefined,_null,"null",undefined,"str",obj); - if (a.lastIndexOf(null) === 13 ) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(null), 13, 'a.lastIndexOf(null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js index 7885347573..b26e8401db 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-7.js @@ -6,16 +6,10 @@ es5id: 15.4.4.15-8-7 description: > Array.prototype.lastIndexOf must return correct index (self reference) -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(0,1,2,3); a[2] = a; - if (a.lastIndexOf(a) === 2 && - a.lastIndexOf(3) === 3 ) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(a), 2, 'a.lastIndexOf(a)'); +assert.sameValue(a.lastIndexOf(3), 3, 'a.lastIndexOf(3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js index 5cd268bdc3..976a95ffde 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-8.js @@ -4,16 +4,10 @@ /*--- es5id: 15.4.4.15-8-8 description: Array.prototype.lastIndexOf 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.lastIndexOf(b.toString()) === 2 && - a.lastIndexOf("0,1") === 2 ) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(b.toString()), 2, 'a.lastIndexOf(b.toString())'); +assert.sameValue(a.lastIndexOf("0,1"), 2, 'a.lastIndexOf("0,1")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js index e97435009e..4137619f15 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-9.js @@ -6,10 +6,8 @@ es5id: 15.4.4.15-8-9 description: > Array.prototype.lastIndexOf 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 index a[4294967295] = 3; // 2^32-1 added as non-array element property @@ -21,9 +19,7 @@ function testcase() { a[4294967202] = 5; - return (a.lastIndexOf(2) === 4294967294 && - a.lastIndexOf(3) === 4294967200 && - a.lastIndexOf(4) === 4294967201 && - a.lastIndexOf(5) === 4294967202) ; - } -runTestCase(testcase); +assert.sameValue(a.lastIndexOf(2), 4294967294, 'a.lastIndexOf(2)'); +assert.sameValue(a.lastIndexOf(3), 4294967200, 'a.lastIndexOf(3)'); +assert.sameValue(a.lastIndexOf(4), 4294967201, 'a.lastIndexOf(4)'); +assert.sameValue(a.lastIndexOf(5), 4294967202, 'a.lastIndexOf(5)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js index b65302a9c0..a65085b9cf 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-1 description: > Array.prototype.lastIndexOf - 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.lastIndexOf.call(arr, "length"); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(arr, "length"), 2, 'Array.prototype.lastIndexOf.call(arr, "length")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js index 3467256c8a..da2fb2d513 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-11 description: > Array.prototype.lastIndexOf - deleting own property causes index property not to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 200 }; Object.defineProperty(arr, "1", { @@ -28,6 +25,4 @@ function testcase() { configurable: true }); - return -1 === Array.prototype.lastIndexOf.call(arr, 6.99); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(arr, 6.99), -1, 'Array.prototype.lastIndexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js index ce32868d03..a0c3e09371 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-12 description: > Array.prototype.lastIndexOf - deleting own property causes index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [1, 2, 3, 4]; Object.defineProperty(arr, "1", { @@ -28,6 +25,4 @@ function testcase() { configurable: true }); - return -1 === arr.lastIndexOf("6.99"); - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf("6.99"), -1, 'arr.lastIndexOf("6.99")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js index d8d085be57..5b0ebef6a2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-17.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-17 description: > Array.prototype.lastIndexOf - decreasing length of array causes index property not to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2, "last", 4]; Object.defineProperty(arr, "4", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return -1 === arr.lastIndexOf("last"); - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf("last"), -1, 'arr.lastIndexOf("last")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js index 34036e64eb..8eab0c85a8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - decreasing length of array does not delete non-configurable properties flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2, 3]; Object.defineProperty(arr, "2", { @@ -29,6 +26,4 @@ function testcase() { configurable: true }); - return 2 === arr.lastIndexOf("unconfigurable"); - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf("unconfigurable"), 2, 'arr.lastIndexOf("unconfigurable")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js index 0f814bac0a..176650e595 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-2 description: > Array.prototype.lastIndexOf - 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.lastIndexOf.call(arr, targetObj, fromIndex); - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(arr, targetObj, fromIndex), 4, 'Array.prototype.lastIndexOf.call(arr, targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js index 43c55a6971..7b6a599ded 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-3 description: > Array.prototype.lastIndexOf - 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.lastIndexOf(targetObj, fromIndex); - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(targetObj, fromIndex), 4, 'arr.lastIndexOf(targetObj, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js index ac4310297e..75bab0fb81 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-4 description: > Array.prototype.lastIndexOf - 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.lastIndexOf.call(arr, 6.99); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(arr, 6.99), -1, 'Array.prototype.lastIndexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js index 21ec4779b4..d4e8197b03 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-5 description: > Array.prototype.lastIndexOf - deleted properties of 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.lastIndexOf.call(arr, false, fromIndex); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(arr, false, fromIndex), -1, 'Array.prototype.lastIndexOf.call(arr, false, fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js index b0af673fff..3a2fc602fd 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-6 description: > Array.prototype.lastIndexOf - deleted properties of 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.lastIndexOf("10", fromIndex); - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf("10", fromIndex), -1, 'arr.lastIndexOf("10", fromIndex)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js index 3c5895fb3b..83d99da606 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-7 description: > Array.prototype.lastIndexOf - properties added into own object after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 8 }; Object.defineProperty(arr, "4", { @@ -26,6 +23,4 @@ function testcase() { configurable: true }); - return Array.prototype.lastIndexOf.call(arr, 1) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), 1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js index d63c551b53..aa51b656e0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-8 description: > Array.prototype.lastIndexOf - 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, "2", { @@ -26,6 +23,4 @@ function testcase() { configurable: true }); - return arr.lastIndexOf(1) === 1; - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(1), 1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js index 324c9a45b3..38c04f33ec 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-1.js @@ -6,15 +6,10 @@ es5id: 15.4.4.15-8-b-i-1 description: > Array.prototype.lastIndexOf - 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.lastIndexOf.call(obj, 0) === 0 && - Array.prototype.lastIndexOf.call(obj, 1) === 1 && - Array.prototype.lastIndexOf.call(obj, 2) === 2; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), 0, 'Array.prototype.lastIndexOf.call(obj, 0)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), 1, 'Array.prototype.lastIndexOf.call(obj, 1)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), 2, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js index 1a82655ab0..48a5f6129a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-10 description: > Array.prototype.lastIndexOf - 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.lastIndexOf.call(obj, 0) && - 1 === Array.prototype.lastIndexOf.call(obj, 1) && - 2 === Array.prototype.lastIndexOf.call(obj, 2); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 0), 0, 'Array.prototype.lastIndexOf.call(obj, 0)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), 1, 'Array.prototype.lastIndexOf.call(obj, 1)'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 2), 2, 'Array.prototype.lastIndexOf.call(obj, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js index 7621d46c18..8647750c98 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-17.js @@ -6,17 +6,12 @@ es5id: 15.4.4.15-8-b-i-17 description: > Array.prototype.lastIndexOf - 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.lastIndexOf(undefined) === 0; - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(undefined), 0, 'arr.lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js index 146887c824..f45757d193 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-18.js @@ -6,17 +6,12 @@ es5id: 15.4.4.15-8-b-i-18 description: > Array.prototype.lastIndexOf - 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.lastIndexOf.call(obj, undefined); - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), 0, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js index 8fb4943e72..25feef567b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-25.js @@ -7,16 +7,11 @@ description: > Array.prototype.lastIndexOf 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.lastIndexOf.call(arguments, arguments[0]) && -1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]); }; - return func(true); - } -runTestCase(testcase); +assert(func(true), 'func(true) !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js index 49a7a91231..3c9044538d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-26.js @@ -7,17 +7,12 @@ description: > Array.prototype.lastIndexOf 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.lastIndexOf.call(arguments, arguments[0]) && 1 === Array.prototype.lastIndexOf.call(arguments, arguments[1]) && -1 === Array.prototype.lastIndexOf.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/lastIndexOf/15.4.4.15-8-b-i-28.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-28.js index 9339ac9dd8..b267199c8a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-28.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-28 description: > Array.prototype.lastIndexOf - 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.lastIndexOf(true) === 1; - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(true), 1, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js index 2e9a15ec8a..57abd4ba0a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-29.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-29 description: > Array.prototype.lastIndexOf - side-effects are visible in subsequent iterations on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var preIterVisible = false; var obj = { length: 3 }; @@ -33,6 +30,4 @@ function testcase() { configurable: true }); - return Array.prototype.lastIndexOf.call(obj, true) === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 1, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js index 3b8e394ab2..ea022e0fe7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-9 description: > Array.prototype.lastIndexOf - 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.lastIndexOf(0) === 0 && arr.lastIndexOf(1) === 1 && arr.lastIndexOf(2) === 2; - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(0), 0, 'arr.lastIndexOf(0)'); +assert.sameValue(arr.lastIndexOf(1), 1, 'arr.lastIndexOf(1)'); +assert.sameValue(arr.lastIndexOf(2), 2, 'arr.lastIndexOf(2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js index aa3e4a53b5..1437a8037d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-11.js @@ -6,14 +6,10 @@ es5id: 15.4.4.15-8-b-ii-11 description: > Array.prototype.lastIndexOf - both array element and search element are Objects, and they refer to the same object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj1 = {}; var obj2 = {}; var obj3 = obj2; - return [obj2, obj1].lastIndexOf(obj3) === 0; - } -runTestCase(testcase); + +assert.sameValue([obj2, obj1].lastIndexOf(obj3), 0, '[obj2, obj1].lastIndexOf(obj3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js index ad455f967f..fa8d820f8b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-2.js @@ -6,10 +6,8 @@ es5id: 15.4.4.15-8-b-iii-2 description: > Array.prototype.lastIndexOf returns without visiting subsequent element once search value is found -includes: [runTestCase.js] ---*/ -function testcase() { var arr = [2, 1, , 1, 2]; var elementFirstAccessed = false; var elementThirdAccessed = false; @@ -30,6 +28,6 @@ function testcase() { }); arr.lastIndexOf(2); - return !elementThirdAccessed && !elementFirstAccessed; - } -runTestCase(testcase); + +assert.sameValue(elementThirdAccessed, false, 'elementThirdAccessed'); +assert.sameValue(elementFirstAccessed, false, 'elementFirstAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js index f6c21efeda..c27b07ed94 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-2.js @@ -6,18 +6,14 @@ es5id: 15.4.4.15-9-2 description: > Array.prototype.lastIndexOf 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;}}); var i = Array.prototype.lastIndexOf.call(f,1); - if (i === -1 && accessed==false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, -1, 'i'); +assert.sameValue(accessed, false, 'accessed');