From 1b14708467b4cab8055effad884071123637e475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Fri, 7 Aug 2015 18:40:21 +0200 Subject: [PATCH 1/2] Replace runTestCase with assert helpers [test/built-ins] --- test/built-ins/Array/isArray/15.4.3.2-1-1.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-10.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-11.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-12.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-15.js | 10 ++-------- test/built-ins/Array/isArray/15.4.3.2-1-2.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-3.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-4.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-5.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-6.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-7.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-8.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-1-9.js | 7 +------ test/built-ins/Array/isArray/15.4.3.2-2-3.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-1-7.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-5-13.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-5-14.js | 8 ++------ .../Array/prototype/indexOf/15.4.4.14-5-15.js | 9 ++------- .../Array/prototype/indexOf/15.4.4.14-5-17.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-5-33.js | 15 +++++---------- .../Array/prototype/indexOf/15.4.4.14-5-7.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-5-8.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-5-9.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-7-1.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-7-2.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-7-3.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-7-4.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-7-5.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-8-2.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-8-3.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-8-4.js | 7 +------ .../Array/prototype/indexOf/15.4.4.14-9-b-1.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-i-2.js | 10 +++------- .../prototype/indexOf/15.4.4.14-9-b-ii-1.js | 17 ++++++----------- .../prototype/indexOf/15.4.4.14-9-b-ii-10.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-ii-11.js | 8 ++------ .../prototype/indexOf/15.4.4.14-9-b-ii-2.js | 8 ++------ .../prototype/indexOf/15.4.4.14-9-b-ii-3.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-ii-4.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-ii-5.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-ii-6.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-ii-7.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-ii-8.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-ii-9.js | 7 +------ .../prototype/indexOf/15.4.4.14-9-b-iii-1.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-1-7.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-5-13.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-5-14.js | 14 +++++--------- .../prototype/lastIndexOf/15.4.4.15-5-15.js | 9 ++------- .../prototype/lastIndexOf/15.4.4.15-5-17.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-5-33.js | 15 +++++---------- .../prototype/lastIndexOf/15.4.4.15-5-8.js | 9 ++------- .../prototype/lastIndexOf/15.4.4.15-5-9.js | 9 ++------- .../prototype/lastIndexOf/15.4.4.15-6-2.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-6-3.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-6-4.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-6-5.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-6-6.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-7-2.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-7-3.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-7-4.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-1.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-i-2.js | 10 +++------- .../prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js | 17 ++++++----------- .../lastIndexOf/15.4.4.15-8-b-ii-10.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js | 8 ++------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js | 6 +----- .../prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js | 7 +------ .../prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js | 7 +------ .../lastIndexOf/15.4.4.15-8-b-iii-1.js | 7 +------ .../Array/prototype/reduce/15.4.4.21-7-1.js | 11 +---------- .../Array/prototype/reduce/15.4.4.21-7-10.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-7-11.js | 8 ++------ .../Array/prototype/reduce/15.4.4.21-7-2.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-7-3.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-7-4.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-7-5.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-7-6.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-7-7.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-7-8.js | 10 +--------- .../Array/prototype/reduce/15.4.4.21-7-9.js | 10 +--------- .../prototype/reduce/15.4.4.21-8-b-ii-1.js | 7 +------ .../prototype/reduce/15.4.4.21-8-b-ii-2.js | 7 +------ .../prototype/reduceRight/15.4.4.22-5-9.js | 8 ++------ .../prototype/reduceRight/15.4.4.22-7-1.js | 11 +---------- .../prototype/reduceRight/15.4.4.22-7-10.js | 8 ++------ .../prototype/reduceRight/15.4.4.22-7-11.js | 8 ++------ .../prototype/reduceRight/15.4.4.22-7-2.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-7-3.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-7-4.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-7-5.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-7-6.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-7-7.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-7-8.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-7-9.js | 10 +--------- .../prototype/reduceRight/15.4.4.22-8-b-ii-2.js | 7 +------ test/built-ins/Date/now/15.9.4.4-0-1.js | 6 +----- test/built-ins/Date/now/15.9.4.4-0-2.js | 6 +----- test/built-ins/Date/now/15.9.4.4-0-4.js | 6 +----- .../Date/prototype/toISOString/15.9.5.43-0-2.js | 6 +----- .../Date/prototype/toISOString/15.9.5.43-0-3.js | 6 +----- test/built-ins/Error/15.11-1.js | 6 +----- test/built-ins/Error/15.11-2.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g2-1.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g2-5.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g5-1.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g6-1.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g6-2.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g6-3.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g6-4.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g6-5.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g6-6.js | 6 +----- test/built-ins/JSON/parse/15.12.1.1-g6-7.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-1.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-10.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-11.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-12.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-13.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-14.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-15.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-2.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-3.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-4.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-5.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-6.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-7.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-8.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-11-9.js | 6 +----- test/built-ins/JSON/stringify/15.12.3-4-1.js | 9 +-------- .../built-ins/JSON/stringify/15.12.3_2-3-a-1.js | 6 +----- .../built-ins/JSON/stringify/15.12.3_2-3-a-2.js | 6 +----- .../built-ins/JSON/stringify/15.12.3_2-3-a-3.js | 6 +----- test/built-ins/Math/max/15.8.2.11-1.js | 6 +----- test/built-ins/Math/min/15.8.2.12-1.js | 6 +----- .../Number/isNaN/Number.isNaN_Boolean.js | 6 +----- test/built-ins/Number/isNaN/Number.isNaN_NaN.js | 6 +----- .../Number/isNaN/Number.isNaN_Object.js | 6 +----- .../Number/isNaN/Number.isNaN_String.js | 6 +----- .../RegExp/prototype/lastIndex/15.10.7.5-1.js | 6 +----- .../String/prototype/trim/15.5.4.20-1-3.js | 13 +------------ .../String/prototype/trim/15.5.4.20-1-4.js | 13 +------------ .../String/prototype/trim/15.5.4.20-1-5.js | 13 +------------ .../String/prototype/trim/15.5.4.20-1-6.js | 13 +------------ .../String/prototype/trim/15.5.4.20-1-7.js | 13 +------------ .../String/prototype/trim/15.5.4.20-2-1.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-10.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-11.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-12.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-13.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-14.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-15.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-16.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-17.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-18.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-19.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-2.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-20.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-21.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-22.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-23.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-24.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-25.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-26.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-27.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-28.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-29.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-3.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-30.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-31.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-32.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-33.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-34.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-35.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-36.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-37.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-4.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-47.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-5.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-6.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-7.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-8.js | 6 +----- .../String/prototype/trim/15.5.4.20-2-9.js | 6 +----- .../String/prototype/trim/15.5.4.20-3-10.js | 6 +----- .../String/prototype/trim/15.5.4.20-3-11.js | 6 +----- .../String/prototype/trim/15.5.4.20-3-12.js | 6 +----- .../String/prototype/trim/15.5.4.20-3-13.js | 6 +----- .../String/prototype/trim/15.5.4.20-3-14.js | 6 +----- .../String/prototype/trim/15.5.4.20-3-8.js | 6 +----- .../String/prototype/trim/15.5.4.20-3-9.js | 6 +----- .../String/prototype/trim/15.5.4.20-4-10.js | 6 +----- .../String/prototype/trim/15.5.4.20-4-18.js | 6 +----- .../String/prototype/trim/15.5.4.20-4-34.js | 6 +----- .../String/prototype/trim/15.5.4.20-4-39.js | 6 +----- test/built-ins/parseFloat/15.1.2.3-2-1.js | 7 ++----- test/built-ins/parseInt/15.1.2.2-2-1.js | 7 ++----- test/language/expressions/delete/11.4.1-2-1.js | 9 ++------- .../expressions/delete/11.4.1-4.a-17.js | 7 +------ .../expressions/unary-minus/11.4.7-4-1.js | 6 +----- .../expressions/unary-plus/11.4.6-2-1.js | 6 +----- 203 files changed, 246 insertions(+), 1240 deletions(-) diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-1.js b/test/built-ins/Array/isArray/15.4.3.2-1-1.js index d89e4cd2a3..2374fd7efd 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-1.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-1.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-1 description: Array.isArray applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(true); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(true), false, 'Array.isArray(true)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-10.js b/test/built-ins/Array/isArray/15.4.3.2-1-10.js index ee02196fc9..395c3b4dc1 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-10.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-10.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-10 description: Array.isArray applied to RegExp object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new RegExp()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new RegExp()), false, 'Array.isArray(new RegExp())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-11.js b/test/built-ins/Array/isArray/15.4.3.2-1-11.js index fdb958b431..6a83171f9c 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-11.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-11.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-11 description: Array.isArray applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(JSON); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(JSON), false, 'Array.isArray(JSON)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-12.js b/test/built-ins/Array/isArray/15.4.3.2-1-12.js index 333e2bb817..2b1aaa798e 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-12.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-12.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-12 description: Array.isArray applied to Error object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new SyntaxError()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new SyntaxError()), false, 'Array.isArray(new SyntaxError())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-15.js b/test/built-ins/Array/isArray/15.4.3.2-1-15.js index 12645ff982..048859180c 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-15.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-15.js @@ -4,13 +4,7 @@ /*--- es5id: 15.4.3.2-1-15 description: Array.isArray applied to the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - - return !Array.isArray(fnGlobalObject()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(fnGlobalObject()), false, 'Array.isArray(fnGlobalObject())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-2.js b/test/built-ins/Array/isArray/15.4.3.2-1-2.js index b79d46bae4..94624b5205 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-2.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-2.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-2 description: Array.isArray applied to Boolean Object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new Boolean(false)); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new Boolean(false)), false, 'Array.isArray(new Boolean(false))'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-3.js b/test/built-ins/Array/isArray/15.4.3.2-1-3.js index e7e0caf5bc..d6a2bf581d 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-3.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-3 description: Array.isArray applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(5); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(5), false, 'Array.isArray(5)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-4.js b/test/built-ins/Array/isArray/15.4.3.2-1-4.js index 5f3d6a378a..dec4307f37 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-4.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-4 description: Array.isArray applied to Number object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new Number(-3)); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new Number(-3)), false, 'Array.isArray(new Number(-3))'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-5.js b/test/built-ins/Array/isArray/15.4.3.2-1-5.js index a8abc5d0da..39777f333d 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-5.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-5 description: Array.isArray applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray("abc"); - } -runTestCase(testcase); +assert.sameValue(Array.isArray("abc"), false, 'Array.isArray("abc")'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-6.js b/test/built-ins/Array/isArray/15.4.3.2-1-6.js index b6c0e1a402..82b6b6aa1e 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-6.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-6.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-6 description: Array.isArray applied to String object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new String("hello\nworld\\!")); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new String("hello\nworld\\!")), false, 'Array.isArray(new String("hello\nworld\\!"))'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-7.js b/test/built-ins/Array/isArray/15.4.3.2-1-7.js index 44af09a804..6bf491fffa 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-7.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-7.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-7 description: Array.isArray applied to Function object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(function () { }); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(function () { }), false, 'Array.isArray(function () { })'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-8.js b/test/built-ins/Array/isArray/15.4.3.2-1-8.js index 2602420aa2..ecb60080ea 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-8.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-8.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-8 description: Array.isArray applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(Math); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(Math), false, 'Array.isArray(Math)'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-1-9.js b/test/built-ins/Array/isArray/15.4.3.2-1-9.js index 688d178f06..31ac3fbf42 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-1-9.js +++ b/test/built-ins/Array/isArray/15.4.3.2-1-9.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.3.2-1-9 description: Array.isArray applied to Date object -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray(new Date()); - } -runTestCase(testcase); +assert.sameValue(Array.isArray(new Date()), false, 'Array.isArray(new Date())'); diff --git a/test/built-ins/Array/isArray/15.4.3.2-2-3.js b/test/built-ins/Array/isArray/15.4.3.2-2-3.js index 5f16b65f06..34459c2dc1 100644 --- a/test/built-ins/Array/isArray/15.4.3.2-2-3.js +++ b/test/built-ins/Array/isArray/15.4.3.2-2-3.js @@ -6,11 +6,6 @@ es5id: 15.4.3.2-2-3 description: > Array.isArray applied to an Array-like object with length and some indexed properties -includes: [runTestCase.js] ---*/ -function testcase() { - - return !Array.isArray({ 0: 12, 1: 9, length: 2 }); - } -runTestCase(testcase); +assert.sameValue(Array.isArray({ 0: 12, 1: 9, length: 2 }), false, 'Array.isArray({ 0: 12, 1: 9, length: 2 })'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js index 0916a43dd6..d48adccb49 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-7.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-1-7 description: Array.prototype.indexOf applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return Array.prototype.indexOf.call("abc", "b") === 1; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call("abc", "b"), 1, 'Array.prototype.indexOf.call("abc", "b")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js index cd36077d21..08f805073f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-13.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-13 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, -Infinity) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, -Infinity), 0, '[true].indexOf(true, -Infinity)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js index 674e03dc76..ad4a1a61f7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-14.js @@ -6,11 +6,7 @@ es5id: 15.4.4.14-5-14 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, NaN) === 0 && [true].indexOf(true, -NaN) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, NaN), 0, '[true].indexOf(true, NaN)'); +assert.sameValue([true].indexOf(true, -NaN), 0, '[true].indexOf(true, -NaN)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js index de7b827c18..6ea2d1a7c7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-15.js @@ -6,12 +6,7 @@ es5id: 15.4.4.14-5-15 description: > Array.prototype.indexOf - value of 'fromIndex' is a string containing a negative number -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true, 2].indexOf(true, "-1") === -1 && - [0, 1, true].indexOf(true, "-1") === 2; - } -runTestCase(testcase); +assert.sameValue([0, true, 2].indexOf(true, "-1"), -1, '[0, true, 2].indexOf(true, "-1")'); +assert.sameValue([0, 1, true].indexOf(true, "-1"), 2, '[0, 1, true].indexOf(true, "-1")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js index e69de33f20..324d58d544 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-17.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-17 description: > Array.prototype.indexOf - value of 'fromIndex' is a string containing -Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, "-Infinity") === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, "-Infinity"), 0, '[true].indexOf(true, "-Infinity")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js index 6c46d4995d..791bc1b6be 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-33.js @@ -6,15 +6,10 @@ es5id: 15.4.4.14-5-33 description: > Array.prototype.indexOf match on the first element, a middle element and the last element when 'fromIndex' is passed -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, 1, 2, 3, 4].indexOf(0, 0) === 0 && - [0, 1, 2, 3, 4].indexOf(2, 1) === 2 && - [0, 1, 2, 3, 4].indexOf(2, 2) === 2 && - [0, 1, 2, 3, 4].indexOf(4, 2) === 4 && - [0, 1, 2, 3, 4].indexOf(4, 4) === 4; - } -runTestCase(testcase); +assert.sameValue([0, 1, 2, 3, 4].indexOf(0, 0), 0, '[0, 1, 2, 3, 4].indexOf(0, 0)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(2, 1), 2, '[0, 1, 2, 3, 4].indexOf(2, 1)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(2, 2), 2, '[0, 1, 2, 3, 4].indexOf(2, 2)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(4, 2), 4, '[0, 1, 2, 3, 4].indexOf(4, 2)'); +assert.sameValue([0, 1, 2, 3, 4].indexOf(4, 4), 4, '[0, 1, 2, 3, 4].indexOf(4, 4)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js index 77021d2c05..0be678f979 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-7.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-7 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, 0) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, 0), 0, '[true].indexOf(true, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js index 439deeabd0..a703e616f8 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-8.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-8 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, +0) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, +0), 0, '[true].indexOf(true, +0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js index 2b2fa9b077..44d8c0887b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-9.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-5-9 description: > Array.prototype.indexOf - value of 'fromIndex' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].indexOf(true, -0) === 0; - } -runTestCase(testcase); +assert.sameValue([true].indexOf(true, -0), 0, '[true].indexOf(true, -0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js index 44cb45a3ee..77db068802 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-1.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-7-1 description: > Array.prototype.indexOf returns -1 when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(1, 2) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(1, 2), -1, '[1, 2, 3].indexOf(1, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js index 2a85858303..e2d4af59ff 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-7-2 description: > Array.prototype.indexOf returns correct index when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(3, 2) === 2; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(3, 2), 2, '[1, 2, 3].indexOf(3, 2)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js index 44f682486e..f6ffe860f7 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-7-3 description: > Array.prototype.indexOf returns -1 when 'fromIndex' and 'length' are both 0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [].indexOf(1, 0) === -1; - } -runTestCase(testcase); +assert.sameValue([].indexOf(1, 0), -1, '[].indexOf(1, 0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js index 09db35e375..9b9986a414 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-7-4 description: Array.prototype.indexOf returns -1 when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(1, 1) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(1, 1), -1, '[1, 2, 3].indexOf(1, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js index ab2db3e5f9..dff5a445d6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-7-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-7-5 description: Array.prototype.indexOf returns correct index when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].indexOf(2, 1) === 1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].indexOf(2, 1), 1, '[1, 2, 3].indexOf(2, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js index c65c70213e..02441ef35a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-8-2 description: > Array.prototype.indexOf returns correct index when 'fromIndex' is -1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].indexOf(4, -1) === 3; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].indexOf(4, -1), 3, '[1, 2, 3, 4].indexOf(4, -1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js index e195d0e06f..8c004c8010 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-8-3 description: > Array.prototype.indexOf returns -1 when abs('fromIndex') is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].indexOf(1, -3) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].indexOf(1, -3), -1, '[1, 2, 3, 4].indexOf(1, -3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js index 8db32ee4b5..33b2459bd3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-8-4.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-8-4 description: > Array.prototype.indexOf returns -1 when abs('fromIndex') is length of array -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].indexOf(0, -4) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].indexOf(0, -4), -1, '[1, 2, 3, 4].indexOf(0, -4)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js index 63093afc93..cd0be7aa50 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-1.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-9-b-1 description: Array.prototype.indexOf - non-existent property wouldn't be called -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, , 2].indexOf(undefined) === -1; - } -runTestCase(testcase); +assert.sameValue([0, , 2].indexOf(undefined), -1, '[0, , 2].indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js index 6a22313a40..c37adf4dbb 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-2.js @@ -6,12 +6,8 @@ es5id: 15.4.4.14-9-b-i-2 description: > Array.prototype.indexOf - element to be retrieved is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - return [true, true, true].indexOf(true) === 0 && - [false, true, true].indexOf(true) === 1 && - [false, false, true].indexOf(true) === 2; - } -runTestCase(testcase); +assert.sameValue([true, true, true].indexOf(true), 0, '[true, true, true].indexOf(true)'); +assert.sameValue([false, true, true].indexOf(true), 1, '[false, true, true].indexOf(true)'); +assert.sameValue([false, false, true].indexOf(true), 2, '[false, false, true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js index 0f9dceb187..9551e31c79 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-1.js @@ -6,16 +6,11 @@ es5id: 15.4.4.14-9-b-ii-1 description: > Array.prototype.indexOf - type of array element is different from type of search element -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["true"].indexOf(true) === -1 && - ["0"].indexOf(0) === -1 && - [false].indexOf(0) === -1 && - [undefined].indexOf(0) === -1 && - [null].indexOf(0) === -1 && - [[]].indexOf(0) === -1; - } -runTestCase(testcase); +assert.sameValue(["true"].indexOf(true), -1, '["true"].indexOf(true)'); +assert.sameValue(["0"].indexOf(0), -1, '["0"].indexOf(0)'); +assert.sameValue([false].indexOf(0), -1, '[false].indexOf(0)'); +assert.sameValue([undefined].indexOf(0), -1, '[undefined].indexOf(0)'); +assert.sameValue([null].indexOf(0), -1, '[null].indexOf(0)'); +assert.sameValue([[]].indexOf(0), -1, '[[]].indexOf(0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js index d994687cf8..c5e6b04d16 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-10.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-10 description: > Array.prototype.indexOf - both array element and search element are Boolean type, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [false, true].indexOf(true) === 1; - } -runTestCase(testcase); +assert.sameValue([false, true].indexOf(true), 1, '[false, true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js index 47bd171aaf..a47ce01397 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-11.js @@ -6,14 +6,10 @@ es5id: 15.4.4.14-9-b-ii-11 description: > Array.prototype.indexOf - both array element and search element are Object type, and they refer to the same object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj1 = {}; var obj2 = {}; var obj3 = obj2; - return [{}, obj1, obj2].indexOf(obj3) === 2; - } -runTestCase(testcase); + +assert.sameValue([{}, obj1, obj2].indexOf(obj3), 2, '[{}, obj1, obj2].indexOf(obj3)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js index f5eacb27ee..77e3af80c3 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-2.js @@ -6,11 +6,7 @@ es5id: 15.4.4.14-9-b-ii-2 description: > Array.prototype.indexOf - both type of array element and type of search element are Undefined -includes: [runTestCase.js] ---*/ -function testcase() { - - return [undefined].indexOf() === 0 && [undefined].indexOf(undefined) === 0; - } -runTestCase(testcase); +assert.sameValue([undefined].indexOf(), 0, '[undefined].indexOf()'); +assert.sameValue([undefined].indexOf(undefined), 0, '[undefined].indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js index 3674c2b54a..6941589c7c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-3 description: > Array.prototype.indexOf - both type of array element and type of search element are null -includes: [runTestCase.js] ---*/ -function testcase() { - - return [null].indexOf(null) === 0; - } -runTestCase(testcase); +assert.sameValue([null].indexOf(null), 0, '[null].indexOf(null)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js index a3a6cada60..0cbb8224b5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-9-b-ii-4 description: Array.prototype.indexOf - search element is NaN -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+NaN, NaN, -NaN].indexOf(NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].indexOf(NaN), -1, '[+NaN, NaN, -NaN].indexOf(NaN)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js index 337c8fae35..e31dfff982 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.14-9-b-ii-5 description: Array.prototype.indexOf - search element is -NaN -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+NaN, NaN, -NaN].indexOf(-NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].indexOf(-NaN), -1, '[+NaN, NaN, -NaN].indexOf(-NaN)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js index c93162e4d5..75eda5e675 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-6.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-6 description: > Array.prototype.indexOf - array element is +0 and search element is -0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+0].indexOf(-0) === 0; - } -runTestCase(testcase); +assert.sameValue([+0].indexOf(-0), 0, '[+0].indexOf(-0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js index 6184e05e18..c3acc3530f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-7.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-7 description: > Array.prototype.indexOf - array element is -0 and search element is +0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-0].indexOf(+0) === 0; - } -runTestCase(testcase); +assert.sameValue([-0].indexOf(+0), 0, '[-0].indexOf(+0)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js index 50ea1b629b..2cedb40c24 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-8.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-8 description: > Array.prototype.indexOf - both array element and search element are Number, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-1, 0, 1].indexOf(1) === 2; - } -runTestCase(testcase); +assert.sameValue([-1, 0, 1].indexOf(1), 2, '[-1, 0, 1].indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js index 959250a896..e5499b6638 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-ii-9.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-ii-9 description: > Array.prototype.indexOf - both array element and search element are String, and they have exactly the same sequence of characters -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["", "ab", "bca", "abc"].indexOf("abc") === 3; - } -runTestCase(testcase); +assert.sameValue(["", "ab", "bca", "abc"].indexOf("abc"), 3, '["", "ab", "bca", "abc"].indexOf("abc")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js index fa1d4e5d09..1e9bc0d3cf 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-iii-1.js @@ -6,11 +6,6 @@ es5id: 15.4.4.14-9-b-iii-1 description: > Array.prototype.indexOf - returns index of last one when more than two elements in array are eligible -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 2, 1, 2].indexOf(2) === 1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 2, 1, 2].indexOf(2), 1, '[1, 2, 2, 1, 2].indexOf(2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js index caf111c8f0..11ed44ee70 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-7.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-1-7 description: Array.prototype.lastIndexOf applied to string primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - return Array.prototype.lastIndexOf.call("abc", "c") === 2; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call("abc", "c"), 2, 'Array.prototype.lastIndexOf.call("abc", "c")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js index 7b789da46d..f92d51835c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-13.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-5-13 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].lastIndexOf(true, -Infinity) === -1; - } -runTestCase(testcase); +assert.sameValue([true].lastIndexOf(true, -Infinity), -1, '[true].lastIndexOf(true, -Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js index 32b9e429ca..7e08f9923c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-14.js @@ -6,14 +6,10 @@ es5id: 15.4.4.15-5-14 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true].lastIndexOf(true, NaN) === -1 && // from Index will be convert to +0 - [true, 0].lastIndexOf(true, NaN) === 0 && - [0, true].lastIndexOf(true, -NaN) === -1 && - [true, 0].lastIndexOf(true, -NaN) === 0; - } -runTestCase(testcase); +// from Index will be convert to +0 +assert.sameValue([0, true].lastIndexOf(true, NaN), -1, '[0, true].lastIndexOf(true, NaN)'); +assert.sameValue([true, 0].lastIndexOf(true, NaN), 0, '[true, 0].lastIndexOf(true, NaN)'); +assert.sameValue([0, true].lastIndexOf(true, -NaN), -1, '[0, true].lastIndexOf(true, -NaN)'); +assert.sameValue([true, 0].lastIndexOf(true, -NaN), 0, '[true, 0].lastIndexOf(true, -NaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js index 51ca82ad79..295b118096 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-15.js @@ -6,12 +6,7 @@ es5id: 15.4.4.15-5-15 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing a negative number -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, "-2", 2].lastIndexOf("-2", "-2") === 1 && - [0, 2, "-2"].lastIndexOf("-2", "-2") === -1; - } -runTestCase(testcase); +assert.sameValue([0, "-2", 2].lastIndexOf("-2", "-2"), 1, '[0, "-2", 2].lastIndexOf("-2", "-2")'); +assert.sameValue([0, 2, "-2"].lastIndexOf("-2", "-2"), -1, '[0, 2, "-2"].lastIndexOf("-2", "-2")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js index 5508b81ce4..1d994c5042 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-17.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-5-17 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a string containing -Infinity -includes: [runTestCase.js] ---*/ -function testcase() { - - return [true].lastIndexOf(true, "-Infinity") === -1; - } -runTestCase(testcase); +assert.sameValue([true].lastIndexOf(true, "-Infinity"), -1, '[true].lastIndexOf(true, "-Infinity")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js index 3486b0ce87..fc8f059e2a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-33.js @@ -6,15 +6,10 @@ es5id: 15.4.4.15-5-33 description: > Array.prototype.lastIndexOf - match on the first element, a middle element and the last element when 'fromIndex' is passed -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, 1, 2, 3, 4].lastIndexOf(0, 0) === 0 && - [0, 1, 2, 3, 4].lastIndexOf(0, 2) === 0 && - [0, 1, 2, 3, 4].lastIndexOf(2, 2) === 2 && - [0, 1, 2, 3, 4].lastIndexOf(2, 4) === 2 && - [0, 1, 2, 3, 4].lastIndexOf(4, 4) === 4; - } -runTestCase(testcase); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(0, 0), 0, '[0, 1, 2, 3, 4].lastIndexOf(0, 0)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(0, 2), 0, '[0, 1, 2, 3, 4].lastIndexOf(0, 2)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(2, 2), 2, '[0, 1, 2, 3, 4].lastIndexOf(2, 2)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(2, 4), 2, '[0, 1, 2, 3, 4].lastIndexOf(2, 4)'); +assert.sameValue([0, 1, 2, 3, 4].lastIndexOf(4, 4), 4, '[0, 1, 2, 3, 4].lastIndexOf(4, 4)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js index 426ee071f3..ddd70c04ce 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-8.js @@ -6,12 +6,7 @@ es5id: 15.4.4.15-5-8 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true].lastIndexOf(true, +0) === -1 && - [true, 0].lastIndexOf(true, +0) === 0; - } -runTestCase(testcase); +assert.sameValue([0, true].lastIndexOf(true, +0), -1, '[0, true].lastIndexOf(true, +0)'); +assert.sameValue([true, 0].lastIndexOf(true, +0), 0, '[true, 0].lastIndexOf(true, +0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js index e1d6ae2d1e..5ecdcb1d8c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-9.js @@ -6,12 +6,7 @@ es5id: 15.4.4.15-5-9 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, true].lastIndexOf(true, -0) === -1 && - [true, 0].lastIndexOf(true, -0) === 0; - } -runTestCase(testcase); +assert.sameValue([0, true].lastIndexOf(true, -0), -1, '[0, true].lastIndexOf(true, -0)'); +assert.sameValue([true, 0].lastIndexOf(true, -0), 0, '[true, 0].lastIndexOf(true, -0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js index f47cab40a7..3015f756c9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-2 description: > Array.prototype.lastIndexOf returns correct index when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(3, 2) === 2; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(3, 2), 2, '[1, 2, 3].lastIndexOf(3, 2)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js index 6f64ea3a73..d994fd9abe 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-3 description: > Array.prototype.lastIndexOf returns -1 when 'fromIndex' is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(3, 1) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(3, 1), -1, '[1, 2, 3].lastIndexOf(3, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js index 8447670107..580791ef5b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-4.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-4 description: > Array.prototype.lastIndexOf returns -1 when 'fromIndex' and 'length' are both 0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [].lastIndexOf(1, 0) === -1; - } -runTestCase(testcase); +assert.sameValue([].lastIndexOf(1, 0), -1, '[].lastIndexOf(1, 0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js index ba40a95ce1..a1f9d14053 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-5.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-6-5 description: Array.prototype.lastIndexOf returns -1 when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(3, 1) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(3, 1), -1, '[1, 2, 3].lastIndexOf(3, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js index 8e1ca80bba..a4a313ab25 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-6-6.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-6-6 description: > Array.prototype.lastIndexOf returns correct index when 'fromIndex' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3].lastIndexOf(2, 1) === 1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3].lastIndexOf(2, 1), 1, '[1, 2, 3].lastIndexOf(2, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js index 779e9b5c7e..35195a5b69 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-2.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-7-2 description: > Array.prototype.lastIndexOf returns correct index when 'fromIndex' is -1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].lastIndexOf(4, -1) === 3; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].lastIndexOf(4, -1), 3, '[1, 2, 3, 4].lastIndexOf(4, -1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js index d882c99431..57e6127013 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-7-3 description: > Array.prototype.lastIndexOf returns -1 when abs('fromIndex') is length of array - 1 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].lastIndexOf(3, -3) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].lastIndexOf(3, -3), -1, '[1, 2, 3, 4].lastIndexOf(3, -3)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js index c695f01b2d..973e668e6d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-7-4.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-7-4 description: > Array.prototype.lastIndexOf returns -1 when abs('fromIndex') is length of array -includes: [runTestCase.js] ---*/ -function testcase() { - - return [1, 2, 3, 4].lastIndexOf(2, -4) === -1; - } -runTestCase(testcase); +assert.sameValue([1, 2, 3, 4].lastIndexOf(2, -4), -1, '[1, 2, 3, 4].lastIndexOf(2, -4)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js index c73193e7e2..8798a9405e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-1.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-8-b-1 description: Array.prototype.lastIndexOf - undefined property wouldn't be called -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, , 2].lastIndexOf(undefined) === -1; - } -runTestCase(testcase); +assert.sameValue([0, , 2].lastIndexOf(undefined), -1, '[0, , 2].lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js index 0ca10fbfe4..9d2ac61afb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-2.js @@ -6,12 +6,8 @@ es5id: 15.4.4.15-8-b-i-2 description: > Array.prototype.lastIndexOf - element to be retrieved is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - return [true, true, true].lastIndexOf(true) === 2 && - [true, true, false].lastIndexOf(true) === 1 && - [true, false, false].lastIndexOf(true) === 0; - } -runTestCase(testcase); +assert.sameValue([true, true, true].lastIndexOf(true), 2, '[true, true, true].lastIndexOf(true)'); +assert.sameValue([true, true, false].lastIndexOf(true), 1, '[true, true, false].lastIndexOf(true)'); +assert.sameValue([true, false, false].lastIndexOf(true), 0, '[true, false, false].lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js index c511309121..a506afb155 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-1.js @@ -6,16 +6,11 @@ es5id: 15.4.4.15-8-b-ii-1 description: > Array.prototype.lastIndexOf - type of array element is different from type of search element -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["true"].lastIndexOf(true) === -1 && - ["0"].lastIndexOf(0) === -1 && - [false].lastIndexOf(0) === -1 && - [undefined].lastIndexOf(0) === -1 && - [null].lastIndexOf(0) === -1 && - [[]].lastIndexOf(0) === -1; - } -runTestCase(testcase); +assert.sameValue(["true"].lastIndexOf(true), -1, '["true"].lastIndexOf(true)'); +assert.sameValue(["0"].lastIndexOf(0), -1, '["0"].lastIndexOf(0)'); +assert.sameValue([false].lastIndexOf(0), -1, '[false].lastIndexOf(0)'); +assert.sameValue([undefined].lastIndexOf(0), -1, '[undefined].lastIndexOf(0)'); +assert.sameValue([null].lastIndexOf(0), -1, '[null].lastIndexOf(0)'); +assert.sameValue([[]].lastIndexOf(0), -1, '[[]].lastIndexOf(0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js index 5d05f5291e..a4fe50c447 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-10.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-10 description: > Array.prototype.lastIndexOf - both array element and search element are booleans, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [false, true].lastIndexOf(true) === 1; - } -runTestCase(testcase); +assert.sameValue([false, true].lastIndexOf(true), 1, '[false, true].lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js index 0024fe08a4..c0e766e26e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-2.js @@ -6,11 +6,7 @@ es5id: 15.4.4.15-8-b-ii-2 description: > Array.prototype.lastIndexOf - both type of array element and type of search element are Undefined -includes: [runTestCase.js] ---*/ -function testcase() { - - return [undefined].lastIndexOf() === 0 && [undefined].lastIndexOf(undefined) === 0; - } -runTestCase(testcase); +assert.sameValue([undefined].lastIndexOf(), 0, '[undefined].lastIndexOf()'); +assert.sameValue([undefined].lastIndexOf(undefined), 0, '[undefined].lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js index 2f90ee54e6..53d1aa1d91 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-3.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-3 description: > Array.prototype.lastIndexOf - both type of array element and type of search element are Null -includes: [runTestCase.js] ---*/ -function testcase() { - - return [null].lastIndexOf(null) === 0; - } -runTestCase(testcase); +assert.sameValue([null].lastIndexOf(null), 0, '[null].lastIndexOf(null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js index 466aaf1103..fa9ff7be6d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-4.js @@ -4,11 +4,6 @@ /*--- es5id: 15.4.4.15-8-b-ii-4 description: Array.prototype.lastIndexOf - search element is NaN -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+NaN, NaN, -NaN].lastIndexOf(NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].lastIndexOf(NaN), -1, '[+NaN, NaN, -NaN].lastIndexOf(NaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js index 847952193f..5ee7ff43e9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-5.js @@ -4,10 +4,6 @@ /*--- es5id: 15.4.4.15-8-b-ii-5 description: Array.prototype.lastIndexOf - search element is -NaN -includes: [runTestCase.js] ---*/ -function testcase() { - return [+NaN, NaN, -NaN].lastIndexOf(-NaN) === -1; - } -runTestCase(testcase); +assert.sameValue([+NaN, NaN, -NaN].lastIndexOf(-NaN), -1, '[+NaN, NaN, -NaN].lastIndexOf(-NaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js index 14e29da772..722ae58b78 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-6.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-6 description: > Array.prototype.lastIndexOf - array element is +0 and search element is -0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [+0].lastIndexOf(-0) === 0; - } -runTestCase(testcase); +assert.sameValue([+0].lastIndexOf(-0), 0, '[+0].lastIndexOf(-0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js index 39aa8c6e1c..1cc26df7a2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-7.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-7 description: > Array.prototype.lastIndexOf - array element is -0 and search element is +0 -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-0].lastIndexOf(+0) === 0; - } -runTestCase(testcase); +assert.sameValue([-0].lastIndexOf(+0), 0, '[-0].lastIndexOf(+0)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js index 1132490d3a..96c979125b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-8.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-ii-8 description: > Array.prototype.lastIndexOf - both array element and search element are numbers, and they have same value -includes: [runTestCase.js] ---*/ -function testcase() { - - return [-1, 0, 1].lastIndexOf(-1) === 0; - } -runTestCase(testcase); +assert.sameValue([-1, 0, 1].lastIndexOf(-1), 0, '[-1, 0, 1].lastIndexOf(-1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js index 2beb5cb248..2814fe5bf4 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-ii-9.js @@ -7,11 +7,6 @@ description: > Array.prototype.lastIndexOf - both array element and search element are strings, and they have exactly the same sequence of characters -includes: [runTestCase.js] ---*/ -function testcase() { - - return ["abc", "ab", "bca", ""].lastIndexOf("abc") === 0; - } -runTestCase(testcase); +assert.sameValue(["abc", "ab", "bca", ""].lastIndexOf("abc"), 0, '["abc", "ab", "bca", ""].lastIndexOf("abc")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js index 974ae4a04f..df20781824 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-iii-1.js @@ -6,11 +6,6 @@ es5id: 15.4.4.15-8-b-iii-1 description: > Array.prototype.lastIndexOf returns index of last one when more than two elements in array are eligible -includes: [runTestCase.js] ---*/ -function testcase() { - - return [2, 1, 2, 2, 1].lastIndexOf(2) === 3; - } -runTestCase(testcase); +assert.sameValue([2, 1, 2, 2, 1].lastIndexOf(2), 3, '[2, 1, 2, 2, 1].lastIndexOf(2)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js index 8e1a618399..06f271c97c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-1.js @@ -6,16 +6,7 @@ es5id: 15.4.4.21-7-1 description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (empty array) -includes: [runTestCase.js] ---*/ -function testcase() { function cb(){} - - try { - if([].reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue([].reduce(cb,1), 1, '[].reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js index ce0b9aac2d..5354dfa85b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-10.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.21-7-10 description: Array.prototype.reduce - 'initialValue' is present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is present"; - return str === [].reduce(function () { }, str); - } -runTestCase(testcase); + +assert.sameValue([].reduce(function () { }, str), str, '[].reduce(function () { }, str)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js index b6b99ce1bf..fbda9e9ebb 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-11.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.21-7-11 description: Array.prototype.reduce - 'initialValue' is not present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is not present"; - return str === [str].reduce(function () { }); - } -runTestCase(testcase); + +assert.sameValue([str].reduce(function () { }), str, '[str].reduce(function () { })'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js index 73ae44d164..16a9fbcd7e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-2.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to null (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = null; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js index 9ea1a314b5..552d32da60 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-3.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to false (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = false; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js index 9d90eb60c8..696d3cdad4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-4.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to 0 (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = 0; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js index 864bb4dc49..ffc5f18709 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-5.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to '0' (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = '0'; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js index bfeab2ce68..e00c883a01 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-6.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj with valueOf) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -19,10 +17,4 @@ function testcase() { f.length = o; function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js index 991e6aea18..ca1d17e24b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-7.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj w/o valueOf (toString)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -25,10 +23,4 @@ function testcase() { // resulting string to a number. function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js index aefe0c3da2..1ee25dae57 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-8.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with []) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js index 4b732ef598..e52de88c9f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-7-9.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduce returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with [0]) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduce(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduce(cb,1), 1, 'f.reduce(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js index 95f3d7c248..94e5a5e850 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-ii-1 description: > Array.prototype.reduce - added properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { }; Object.defineProperty(obj, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return Array.prototype.reduce.call(obj, function () { }) === "accumulator"; - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, function () { }), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js index e1c79f25a8..81ac5c5171 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-ii-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-ii-2 description: > Array.prototype.reduce - deleted properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 1: "accumulator", 2: "another" }; Object.defineProperty(obj, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return "accumulator" !== Array.prototype.reduce.call(obj, function () { }); - } -runTestCase(testcase); +assert.notSameValue(Array.prototype.reduce.call(obj, function () { }), "accumulator", 'Array.prototype.reduce.call(obj, function () { })'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js index b143a15569..9c3ff7132b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-9.js @@ -6,12 +6,8 @@ es5id: 15.4.4.22-5-9 description: > Array.prototype.reduceRight - 'initialValue' is returned if 'len' is 0 and 'initialValue' is present -includes: [runTestCase.js] ---*/ -function testcase() { - var initialValue = 10; - return initialValue === [].reduceRight(function () { }, initialValue); - } -runTestCase(testcase); + +assert.sameValue([].reduceRight(function () { }, initialValue), initialValue, '[].reduceRight(function () { }, initialValue)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js index dafb24ae87..c02fb40001 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-1.js @@ -6,16 +6,7 @@ es5id: 15.4.4.22-7-1 description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (empty array) -includes: [runTestCase.js] ---*/ -function testcase() { function cb(){} - - try { - if([].reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue([].reduceRight(cb,1), 1, '[].reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js index 4b1bb71cb7..fbd5ad19ee 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-10.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.22-7-10 description: Array.prototype.reduceRight - 'initialValue' is present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is present"; - return str === [].reduceRight(function () { }, str); - } -runTestCase(testcase); + +assert.sameValue([].reduceRight(function () { }, str), str, '[].reduceRight(function () { }, str)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js index ec4e4b8003..d1c2db342e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-11.js @@ -4,12 +4,8 @@ /*--- es5id: 15.4.4.22-7-11 description: Array.prototype.reduceRight - 'initialValue' is not present -includes: [runTestCase.js] ---*/ -function testcase() { - var str = "initialValue is not present"; - return str === [str].reduceRight(function () { }); - } -runTestCase(testcase); + +assert.sameValue([str].reduceRight(function () { }), str, '[str].reduceRight(function () { })'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js index 129a07a01b..6a2b04b166 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-2.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to null (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = null; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js index 0dea7b8154..58accb2129 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-3.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to false (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = false; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js index 5ee711423b..bf4a4bbbbc 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-4.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to 0 (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = 0; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js index 2f900f368d..a344bd1622 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-5.js @@ -7,20 +7,12 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden to '0' (type conversion)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); f.length = '0'; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js index cb89355522..4c561a34a6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-6.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj with valueOf) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -19,10 +17,4 @@ function testcase() { f.length = o; function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js index 2f35537099..dcc9f4eeaa 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-7.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with obj w/o valueOf (toString)) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -25,10 +23,4 @@ function testcase() { // resulting string to a number. function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js index 9ef8c95c88..1bc3b1634a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-8.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with []) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js index 9484da5a68..40cdd279e4 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-7-9.js @@ -7,10 +7,8 @@ description: > Array.prototype.reduceRight returns initialValue if 'length' is 0 and initialValue is present (subclassed Array, length overridden with [0]) -includes: [runTestCase.js] ---*/ -function testcase() { foo.prototype = new Array(1, 2, 3); function foo() {} var f = new foo(); @@ -32,10 +30,4 @@ function testcase() { // or if its one element is not a number, the array converts to NaN. function cb(){} - try { - if(f.reduceRight(cb,1) === 1) - return true; - } - catch (e) { } - } -runTestCase(testcase); +assert.sameValue(f.reduceRight(cb,1), 1, 'f.reduceRight(cb,1)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js index 156471b6da..7cfafc07f2 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-ii-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-ii-2 description: > Array.prototype.reduceRight - deleted properties in step 2 are visible here -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 2: "accumulator", 3: "another" }; Object.defineProperty(obj, "length", { @@ -21,6 +18,4 @@ function testcase() { configurable: true }); - return "accumulator" !== Array.prototype.reduceRight.call(obj, function () { }); - } -runTestCase(testcase); +assert.notSameValue(Array.prototype.reduceRight.call(obj, function () { }), "accumulator", 'Array.prototype.reduceRight.call(obj, function () { })'); diff --git a/test/built-ins/Date/now/15.9.4.4-0-1.js b/test/built-ins/Date/now/15.9.4.4-0-1.js index 52fc56ef4f..d85d2d6039 100644 --- a/test/built-ins/Date/now/15.9.4.4-0-1.js +++ b/test/built-ins/Date/now/15.9.4.4-0-1.js @@ -4,10 +4,6 @@ /*--- es5id: 15.9.4.4-0-1 description: Date.now must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { - return typeof Date.now === "function"; - } -runTestCase(testcase); +assert.sameValue(typeof Date.now, "function", 'typeof Date.now'); diff --git a/test/built-ins/Date/now/15.9.4.4-0-2.js b/test/built-ins/Date/now/15.9.4.4-0-2.js index 607d4a3882..ee88193a17 100644 --- a/test/built-ins/Date/now/15.9.4.4-0-2.js +++ b/test/built-ins/Date/now/15.9.4.4-0-2.js @@ -4,10 +4,6 @@ /*--- es5id: 15.9.4.4-0-2 description: Date.now must exist as a function taking 0 parameters -includes: [runTestCase.js] ---*/ -function testcase() { - return Date.now.length === 0; - } -runTestCase(testcase); +assert.sameValue(Date.now.length, 0, 'Date.now.length'); diff --git a/test/built-ins/Date/now/15.9.4.4-0-4.js b/test/built-ins/Date/now/15.9.4.4-0-4.js index d2211ca7a2..b6b701e36f 100644 --- a/test/built-ins/Date/now/15.9.4.4-0-4.js +++ b/test/built-ins/Date/now/15.9.4.4-0-4.js @@ -4,10 +4,6 @@ /*--- es5id: 15.9.4.4-0-4 description: Date.now - returns number -includes: [runTestCase.js] ---*/ -function testcase() { - return typeof Date.now() === "number"; - } -runTestCase(testcase); +assert.sameValue(typeof Date.now(), "number", 'typeof Date.now()'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-2.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-2.js index 22c9ee6a13..f3b637b3ba 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-2.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-2.js @@ -6,10 +6,6 @@ es5id: 15.9.5.43-0-2 description: > Date.prototype.toISOString must exist as a function taking 0 parameters -includes: [runTestCase.js] ---*/ -function testcase() { - return Date.prototype.toISOString.length === 0; - } -runTestCase(testcase); +assert.sameValue(Date.prototype.toISOString.length, 0, 'Date.prototype.toISOString.length'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-3.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-3.js index 4c4d93b4d4..8a34c89fa6 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-3.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-3.js @@ -4,10 +4,6 @@ /*--- es5id: 15.9.5.43-0-3 description: Date.prototype.toISOString must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { - return typeof (Date.prototype.toISOString) === "function"; - } -runTestCase(testcase); +assert.sameValue(typeof (Date.prototype.toISOString), "function", 'typeof (Date.prototype.toISOString)'); diff --git a/test/built-ins/Error/15.11-1.js b/test/built-ins/Error/15.11-1.js index 0404c957fc..d66d5dc5fa 100644 --- a/test/built-ins/Error/15.11-1.js +++ b/test/built-ins/Error/15.11-1.js @@ -4,10 +4,6 @@ /*--- es5id: 15.11-1 description: Error - ConversionError has been removed from IE9 standard mode -includes: [runTestCase.js] ---*/ -function testcase() { - return typeof ConversionError === "undefined"; - } -runTestCase(testcase); +assert.sameValue(typeof ConversionError, "undefined", 'typeof ConversionError'); diff --git a/test/built-ins/Error/15.11-2.js b/test/built-ins/Error/15.11-2.js index 41f725d121..4bb74dd4e5 100644 --- a/test/built-ins/Error/15.11-2.js +++ b/test/built-ins/Error/15.11-2.js @@ -4,10 +4,6 @@ /*--- es5id: 15.11-2 description: Error - RegExpError has been removed from IE9 standard mode -includes: [runTestCase.js] ---*/ -function testcase() { - return typeof RegExpError === "undefined"; - } -runTestCase(testcase); +assert.sameValue(typeof RegExpError, "undefined", 'typeof RegExpError'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g2-1.js b/test/built-ins/JSON/parse/15.12.1.1-g2-1.js index 9b480202b8..7358d4ffd7 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g2-1.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g2-1.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.1.1-g2-1 description: JSONStrings can be written using double quotes -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"abc"')==="abc"; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"abc"'), "abc", 'JSON.parse(\'"abc"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g2-5.js b/test/built-ins/JSON/parse/15.12.1.1-g2-5.js index a6c5233538..c9c9d34b6d 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g2-5.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g2-5.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g2-5 description: > A JSONStrings can contain no JSONStringCharacters (Empty JSONStrings) -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('""')===""; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('""'), "", 'JSON.parse(\'""\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g5-1.js b/test/built-ins/JSON/parse/15.12.1.1-g5-1.js index 5aa9e1af99..ebe955db24 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g5-1.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g5-1.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g5-1 description: > The JSON lexical grammar allows Unicode escape sequences in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\u0058"')==='X'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\u0058"'), 'X', 'JSON.parse(\'"\\u0058"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g6-1.js b/test/built-ins/JSON/parse/15.12.1.1-g6-1.js index 59230751eb..68c3da37d5 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g6-1.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g6-1.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g6-1 description: > The JSON lexical grammer allows '/' as a JSONEscapeCharacter after '' in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\/"')==='/'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\/"'), '/', 'JSON.parse(\'"\\/"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g6-2.js b/test/built-ins/JSON/parse/15.12.1.1-g6-2.js index 2b22e1a0ac..5ac859ec06 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g6-2.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g6-2.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g6-2 description: > The JSON lexical grammer allows '' as a JSONEscapeCharacter after '' in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\\\"')==='\\'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\\\"'), '\\', 'JSON.parse(\'"\\\\"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g6-3.js b/test/built-ins/JSON/parse/15.12.1.1-g6-3.js index 6965358554..d18c65d7d5 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g6-3.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g6-3.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g6-3 description: > The JSON lexical grammer allows 'b' as a JSONEscapeCharacter after '' in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\b"')==='\b'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\b"'), '\b', 'JSON.parse(\'"\\b"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g6-4.js b/test/built-ins/JSON/parse/15.12.1.1-g6-4.js index a6fe3bee0c..e36e0c32f4 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g6-4.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g6-4.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g6-4 description: > The JSON lexical grammer allows 'f' as a JSONEscapeCharacter after '' in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\f"')==='\f'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\f"'), '\f', 'JSON.parse(\'"\\f"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g6-5.js b/test/built-ins/JSON/parse/15.12.1.1-g6-5.js index 5eb59afedc..1b9b8a7f46 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g6-5.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g6-5.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g6-5 description: > The JSON lexical grammer allows 'n' as a JSONEscapeCharacter after '' in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\n"')==='\n'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\n"'), '\n', 'JSON.parse(\'"\\n"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g6-6.js b/test/built-ins/JSON/parse/15.12.1.1-g6-6.js index 7be75edae7..a56aa8c218 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g6-6.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g6-6.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g6-6 description: > The JSON lexical grammer allows 'r' as a JSONEscapeCharacter after '' in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\r"')==='\r'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\r"'), '\r', 'JSON.parse(\'"\\r"\')'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g6-7.js b/test/built-ins/JSON/parse/15.12.1.1-g6-7.js index 4c6f451b4b..93d9c3da86 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g6-7.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g6-7.js @@ -6,10 +6,6 @@ es5id: 15.12.1.1-g6-7 description: > The JSON lexical grammer allows 't' as a JSONEscapeCharacter after '' in a JSONString -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.parse('"\\t"')==='\t'; - } -runTestCase(testcase); +assert.sameValue(JSON.parse('"\\t"'), '\t', 'JSON.parse(\'"\\t"\')'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-1.js b/test/built-ins/JSON/stringify/15.12.3-11-1.js index 09ae2ff2b0..13654fbc1b 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-1.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-1 description: JSON.stringify(undefined) returns undefined -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(undefined) === undefined; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(undefined), undefined, 'JSON.stringify(undefined)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-10.js b/test/built-ins/JSON/stringify/15.12.3-11-10.js index 55e651cd4f..f151731964 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-10.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-10.js @@ -6,10 +6,6 @@ es5id: 15.12.3-11-10 description: > A JSON.stringify replacer function applied to a top level scalar value can return undefined. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(42, function(k, v) { return undefined }) === undefined; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(42, function(k, v) { return undefined }), undefined, 'JSON.stringify(42, function(k, v) { return undefined })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-11.js b/test/built-ins/JSON/stringify/15.12.3-11-11.js index 65b7024fe7..da886044b9 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-11.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-11.js @@ -6,10 +6,6 @@ es5id: 15.12.3-11-11 description: > A JSON.stringify replacer function applied to a top level Object can return undefined. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify({prop:1}, function(k, v) { return undefined }) === undefined; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify({prop:1}, function(k, v) { return undefined }), undefined, 'JSON.stringify({prop:1}, function(k, v) { return undefined })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-12.js b/test/built-ins/JSON/stringify/15.12.3-11-12.js index c09996f038..5fdfea8383 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-12.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-12.js @@ -6,10 +6,6 @@ es5id: 15.12.3-11-12 description: > A JSON.stringify replacer function applied to a top level scalar can return an Array. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(42, function(k, v) { return v==42 ?[4,2]:v }) === '[4,2]'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(42, function(k, v) { return v==42 ?[4,2]:v }), '[4,2]', 'JSON.stringify(42, function(k, v) { return v==42 ?[4,2]:v })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-13.js b/test/built-ins/JSON/stringify/15.12.3-11-13.js index d4a08dad44..e98f671164 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-13.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-13.js @@ -6,10 +6,6 @@ es5id: 15.12.3-11-13 description: > A JSON.stringify replacer function applied to a top level scalar can return an Object. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(42, function(k, v) { return v==42 ? {forty:2}: v}) === '{"forty":2}'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(42, function(k, v) { return v==42 ? {forty:2}: v}), '{"forty":2}', 'JSON.stringify(42, function(k, v) { return v==42 ? {forty:2}: v})'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-14.js b/test/built-ins/JSON/stringify/15.12.3-11-14.js index 286960452a..43a27b090d 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-14.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-14.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-14 description: Applying JSON.stringify to a function returns undefined. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(function() {}) === undefined; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(function() {}), undefined, 'JSON.stringify(function() {})'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-15.js b/test/built-ins/JSON/stringify/15.12.3-11-15.js index bfd4433c34..d2cb931914 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-15.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-15.js @@ -6,10 +6,6 @@ es5id: 15.12.3-11-15 description: > Applying JSON.stringify with a replacer function to a function returns the replacer value. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(function() {}, function(k,v) {return 99}) === '99'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(function() {}, function(k,v) {return 99}), '99', 'JSON.stringify(function() {}, function(k,v) {return 99})'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-2.js b/test/built-ins/JSON/stringify/15.12.3-11-2.js index cfe9b629b2..f6dc5e8622 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-2.js @@ -6,10 +6,6 @@ es5id: 15.12.3-11-2 description: > A JSON.stringify replacer function works is applied to a top level undefined value. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(undefined, function(k, v) { return "replacement" }) === '"replacement"'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(undefined, function(k, v) { return "replacement" }), '"replacement"', 'JSON.stringify(undefined, function(k, v) { return "replacement" })'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-3.js b/test/built-ins/JSON/stringify/15.12.3-11-3.js index f82237319e..5d265a1469 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-3.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-3.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-3 description: A JSON.stringify correctly works on top level string values. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify("a string") === '"a string"'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify("a string"), '"a string"', 'JSON.stringify("a string")'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-4.js b/test/built-ins/JSON/stringify/15.12.3-11-4.js index 2fe1b25948..14286a1fe0 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-4.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-4.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-4 description: JSON.stringify correctly works on top level Number values. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(123) === '123'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(123), '123', 'JSON.stringify(123)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-5.js b/test/built-ins/JSON/stringify/15.12.3-11-5.js index 32f8cd6897..95e28dc58e 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-5.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-5.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-5 description: JSON.stringify correctly works on top level Boolean values. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(true) === 'true'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(true), 'true', 'JSON.stringify(true)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-6.js b/test/built-ins/JSON/stringify/15.12.3-11-6.js index 10665c4be0..b4426e9644 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-6.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-6.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-6 description: JSON.stringify correctly works on top level null values. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(null) === 'null'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(null), 'null', 'JSON.stringify(null)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-7.js b/test/built-ins/JSON/stringify/15.12.3-11-7.js index 46ecc1c22a..cd922bcdd7 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-7.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-7.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-7 description: JSON.stringify correctly works on top level Number objects. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(new Number(42)) === '42'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(new Number(42)), '42', 'JSON.stringify(new Number(42))'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-8.js b/test/built-ins/JSON/stringify/15.12.3-11-8.js index 7fa9d3db0d..27bfa5c080 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-8.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-8.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-8 description: JSON.stringify correctly works on top level String objects. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(new String('wrappered')) === '"wrappered"'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(new String('wrappered')), '"wrappered"', 'JSON.stringify(new String(\'wrappered\'))'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-9.js b/test/built-ins/JSON/stringify/15.12.3-11-9.js index e451de11e4..ef5a84af96 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-9.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-9.js @@ -4,10 +4,6 @@ /*--- es5id: 15.12.3-11-9 description: JSON.stringify correctly works on top level Boolean objects. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify(new Boolean(false)) === 'false'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify(new Boolean(false)), 'false', 'JSON.stringify(new Boolean(false))'); diff --git a/test/built-ins/JSON/stringify/15.12.3-4-1.js b/test/built-ins/JSON/stringify/15.12.3-4-1.js index 998083fad7..0f7eafd118 100644 --- a/test/built-ins/JSON/stringify/15.12.3-4-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-4-1.js @@ -6,13 +6,6 @@ es5id: 15.12.3-4-1 description: > JSON.stringify ignores replacer aruguments that are not functions or arrays.. -includes: [runTestCase.js] ---*/ -function testcase() { - try { - return JSON.stringify([42],{})=== '[42]'; - } - catch (e) {return false} - } -runTestCase(testcase); +assert.sameValue(JSON.stringify([42],{}), '[42]', 'JSON.stringify([42],{})'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js b/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js index eb1ce2fdb0..853acb01d6 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-3-a-1.js @@ -6,10 +6,6 @@ es5id: 15.12.3_2-3-a-1 description: > JSON.stringify converts string wrapper objects returned from replacer functions to literal strings. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify([42], function(k,v) {return v===42? new String('fortytwo'):v}) === '["fortytwo"]'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify([42], function(k,v) {return v===42? new String('fortytwo'):v}), '["fortytwo"]', 'JSON.stringify([42], function(k,v) {return v===42? new String("fortytwo"):v})'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js b/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js index 098c836ec0..7888996d77 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-3-a-2.js @@ -6,10 +6,6 @@ es5id: 15.12.3_2-3-a-2 description: > JSON.stringify converts Number wrapper objects returned from replacer functions to literal numbers. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify([42], function(k,v) {return v===42? new Number(84):v}) === '[84]'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify([42], function(k,v) {return v===42? new Number(84):v}), '[84]', 'JSON.stringify([42], function(k,v) {return v===42? new Number(84):v})'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js b/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js index 40dd2febd9..adb582fe20 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-3-a-3.js @@ -6,10 +6,6 @@ es5id: 15.12.3_2-3-a-3 description: > JSON.stringify converts Boolean wrapper objects returned from replacer functions to literal numbers. -includes: [runTestCase.js] ---*/ -function testcase() { - return JSON.stringify([42], function(k,v) {return v===42? new Boolean(false):v}) === '[false]'; - } -runTestCase(testcase); +assert.sameValue(JSON.stringify([42], function(k,v) {return v===42? new Boolean(false):v}), '[false]', 'JSON.stringify([42], function(k,v) {return v===42? new Boolean(false):v})'); diff --git a/test/built-ins/Math/max/15.8.2.11-1.js b/test/built-ins/Math/max/15.8.2.11-1.js index 32848fa09d..f2b6e97c83 100644 --- a/test/built-ins/Math/max/15.8.2.11-1.js +++ b/test/built-ins/Math/max/15.8.2.11-1.js @@ -4,10 +4,6 @@ /*--- es5id: 15.8.2.11-1 description: Math.max({}) is NaN -includes: [runTestCase.js] ---*/ -function testcase() { - return isNaN(Math.max({})); -} -runTestCase(testcase); +assert(isNaN(Math.max({})), 'isNaN(Math.max({})) !== true'); diff --git a/test/built-ins/Math/min/15.8.2.12-1.js b/test/built-ins/Math/min/15.8.2.12-1.js index 5451ebae47..cc749e56d3 100644 --- a/test/built-ins/Math/min/15.8.2.12-1.js +++ b/test/built-ins/Math/min/15.8.2.12-1.js @@ -4,10 +4,6 @@ /*--- es5id: 15.8.2.12-1 description: Math.min({}) is NaN -includes: [runTestCase.js] ---*/ -function testcase() { - return isNaN(Math.min({})); -} -runTestCase(testcase); +assert(isNaN(Math.min({})), 'isNaN(Math.min({})) !== true'); diff --git a/test/built-ins/Number/isNaN/Number.isNaN_Boolean.js b/test/built-ins/Number/isNaN/Number.isNaN_Boolean.js index 3104972841..c4c16b0537 100644 --- a/test/built-ins/Number/isNaN/Number.isNaN_Boolean.js +++ b/test/built-ins/Number/isNaN/Number.isNaN_Boolean.js @@ -5,10 +5,6 @@ es6id: 20.1.2.4 author: Ryan Lewis description: Number.IsNaN should return false if called with a boolean. -includes: [runTestCase.js] ---*/ -function testcase() { - return Number.isNaN(true) === false; - } -runTestCase(testcase); +assert.sameValue(Number.isNaN(true), false, 'Number.isNaN(true)'); diff --git a/test/built-ins/Number/isNaN/Number.isNaN_NaN.js b/test/built-ins/Number/isNaN/Number.isNaN_NaN.js index a5b05d9d61..e70f01e23a 100644 --- a/test/built-ins/Number/isNaN/Number.isNaN_NaN.js +++ b/test/built-ins/Number/isNaN/Number.isNaN_NaN.js @@ -5,10 +5,6 @@ es6id: 20.1.2.4 author: Ryan Lewis description: Number.IsNaN should return true if called with NaN. -includes: [runTestCase.js] ---*/ -function testcase() { - return Number.isNaN(NaN) === true; - } -runTestCase(testcase); +assert.sameValue(Number.isNaN(NaN), true, 'Number.isNaN(NaN)'); diff --git a/test/built-ins/Number/isNaN/Number.isNaN_Object.js b/test/built-ins/Number/isNaN/Number.isNaN_Object.js index 4bbeed55cc..53ede9f324 100644 --- a/test/built-ins/Number/isNaN/Number.isNaN_Object.js +++ b/test/built-ins/Number/isNaN/Number.isNaN_Object.js @@ -7,10 +7,6 @@ author: Ryan Lewis description: > Number.IsNaN should return false if called with a non-number Object. -includes: [runTestCase.js] ---*/ -function testcase() { - return Number.isNaN(new Object()) === false; - } -runTestCase(testcase); +assert.sameValue(Number.isNaN(new Object()), false, 'Number.isNaN(new Object())'); diff --git a/test/built-ins/Number/isNaN/Number.isNaN_String.js b/test/built-ins/Number/isNaN/Number.isNaN_String.js index bc8336ca8e..4ad32bd28d 100644 --- a/test/built-ins/Number/isNaN/Number.isNaN_String.js +++ b/test/built-ins/Number/isNaN/Number.isNaN_String.js @@ -5,10 +5,6 @@ es6id: 20.1.2.4 author: Ryan Lewis description: Number.IsNaN should return false if called with a String. -includes: [runTestCase.js] ---*/ -function testcase() { - return Number.isNaN('string') === false; - } -runTestCase(testcase); +assert.sameValue(Number.isNaN('string'), false, 'Number.isNaN("string")'); diff --git a/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-1.js b/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-1.js index e30965517e..90e2f09b43 100644 --- a/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-1.js +++ b/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-1.js @@ -4,10 +4,6 @@ /*--- es5id: 15.10.7.5-1 description: RegExp.prototype.lastIndex is of type Undefined -includes: [runTestCase.js] ---*/ -function testcase() { - return (typeof(RegExp.prototype.lastIndex)) === 'undefined'; - } -runTestCase(testcase); +assert.sameValue(typeof(RegExp.prototype.lastIndex), 'undefined', 'typeof(RegExp.prototype.lastIndex)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-1-3.js b/test/built-ins/String/prototype/trim/15.5.4.20-1-3.js index 8af334e608..f6eb8351b6 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-1-3.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-1-3.js @@ -4,17 +4,6 @@ /*--- es5id: 15.5.4.20-1-3 description: String.prototype.trim works for primitive type boolean -includes: [runTestCase.js] ---*/ -function testcase() { - try - { - if(String.prototype.trim.call(true) == "true") - return true; - } - catch(e) - { - } - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(true), "true", 'String.prototype.trim.call(true)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-1-4.js b/test/built-ins/String/prototype/trim/15.5.4.20-1-4.js index 65ece9dedb..ae609a55cb 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-1-4.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-1-4.js @@ -4,17 +4,6 @@ /*--- es5id: 15.5.4.20-1-4 description: String.prototype.trim works for primitive type number -includes: [runTestCase.js] ---*/ -function testcase() { - try - { - if(String.prototype.trim.call(0) == "0") - return true; - } - catch(e) - { - } - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(0), "0", 'String.prototype.trim.call(0)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-1-5.js b/test/built-ins/String/prototype/trim/15.5.4.20-1-5.js index 0d4539f9ba..fcfc270eba 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-1-5.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-1-5.js @@ -4,17 +4,6 @@ /*--- es5id: 15.5.4.20-1-5 description: String.prototype.trim works for an Object -includes: [runTestCase.js] ---*/ -function testcase() { - try - { - if(String.prototype.trim.call({})=="[object Object]") - return true; - } - catch(e) - { - } - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call({}), "[object Object]", 'String.prototype.trim.call({})'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-1-6.js b/test/built-ins/String/prototype/trim/15.5.4.20-1-6.js index d0bf2a218a..cd9994eee6 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-1-6.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-1-6.js @@ -4,17 +4,6 @@ /*--- es5id: 15.5.4.20-1-6 description: String.prototype.trim works for an String -includes: [runTestCase.js] ---*/ -function testcase() { - try - { - if(String.prototype.trim.call(new String()) == "") - return true; - } - catch(e) - { - } - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(new String()), "", 'String.prototype.trim.call(new String())'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-1-7.js b/test/built-ins/String/prototype/trim/15.5.4.20-1-7.js index 084cf12b77..28ffc9805c 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-1-7.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-1-7.js @@ -4,17 +4,6 @@ /*--- es5id: 15.5.4.20-1-7 description: String.prototype.trim works for a primitive string -includes: [runTestCase.js] ---*/ -function testcase() { - try - { - if(String.prototype.trim.call("abc") === "abc") - return true; - } - catch(e) - { - } - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call("abc"), "abc", 'String.prototype.trim.call("abc")'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-1.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-1.js index f0dafc7816..0e3d17d8c7 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-1.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-1.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-1 description: > String.prototype.trim - argument 'this' is a boolean whose value is false -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(false) === "false"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(false), "false", 'String.prototype.trim.call(false)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-10.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-10.js index 85597ca39f..ef1b2de425 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-10.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-10.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-10 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is +Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(+Infinity) === "Infinity"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(+Infinity), "Infinity", 'String.prototype.trim.call(+Infinity)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-11.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-11.js index 845ef4a723..fbfdcbffca 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-11.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-11.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-11 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is -Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(-Infinity) === "-Infinity"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(-Infinity), "-Infinity", 'String.prototype.trim.call(-Infinity)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-12.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-12.js index ad4035cd0e..edd592e911 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-12.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-12.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-12 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 20 zeros)) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(100000000000000000000) === "100000000000000000000"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(100000000000000000000), "100000000000000000000", 'String.prototype.trim.call(100000000000000000000)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-13.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-13.js index a8c850b496..5b0f4d2aa7 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-13.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-13.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-13 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 21 zeros)) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(1000000000000000000000) === "1e+21"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(1000000000000000000000), "1e+21", 'String.prototype.trim.call(1000000000000000000000)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-14.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-14.js index 18ecc75e84..0f85c5b159 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-14.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-14.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-14 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 22 zeros)) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(10000000000000000000000) === "1e+22"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(10000000000000000000000), "1e+22", 'String.prototype.trim.call(10000000000000000000000)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-15.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-15.js index d613743dad..441d29f32d 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-15.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-15.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-15 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e+20) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(1e+20) === "100000000000000000000"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(1e+20), "100000000000000000000", 'String.prototype.trim.call(1e+20)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-16.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-16.js index 97f19de0e8..c029bf26ef 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-16.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-16.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-16 description: > String.prototype.trim - argument 'this' is a number that converts to string (value is 1e+21) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(1e+21) === "1e+21"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(1e+21), "1e+21", 'String.prototype.trim.call(1e+21)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-17.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-17.js index 9f770dabfd..c6cbcd387e 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-17.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-17.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-17 description: > String.prototype.trim - argument 'this' is a number that converts to string (value is 1e+22) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(1e+22) === "1e+22"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(1e+22), "1e+22", 'String.prototype.trim.call(1e+22)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-18.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-18.js index 0966a4cf0b..c643cd1841 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-18.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-18.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-18 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 0.000001) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(0.000001) === "0.000001"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(0.000001), "0.000001", 'String.prototype.trim.call(0.000001)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-19.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-19.js index 92ac98e924..1fab05cc22 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-19.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-19.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-19 description: > String.prototype.trim - argument argument 'this' is a number that converts to a string (value is 0.0000001) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(0.0000001) === "1e-7"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(0.0000001), "1e-7", 'String.prototype.trim.call(0.0000001)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-2.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-2.js index e473f1c39d..7c00e4690f 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-2.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-2.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-2 description: > String.prototype.trim - argument 'this' is a boolean whose value is true -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(true) === "true"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(true), "true", 'String.prototype.trim.call(true)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-20.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-20.js index b41403c083..0f8ee61f7d 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-20.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-20.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-20 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 0.00000001) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(0.00000001) === "1e-8"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(0.00000001), "1e-8", 'String.prototype.trim.call(0.00000001)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-21.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-21.js index a2bb7406b6..97657b3599 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-21.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-21.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-21 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e-7) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(1e-7) === "1e-7"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(1e-7), "1e-7", 'String.prototype.trim.call(1e-7)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-22.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-22.js index 2422196c50..b033fd7a60 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-22.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-22.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-22 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e-6) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(1e-6) === "0.000001"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(1e-6), "0.000001", 'String.prototype.trim.call(1e-6)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-23.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-23.js index 22ed0b242a..48a31e9b0c 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-23.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-23.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-23 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1e-5) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(1e-5) === "0.00001"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(1e-5), "0.00001", 'String.prototype.trim.call(1e-5)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-24.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-24.js index f823368b08..495503cb40 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-24.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-24.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-24 description: > String.prototype.trim - argument 'this' is an integer that converts to a string (value is 123) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(123) === "123"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(123), "123", 'String.prototype.trim.call(123)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-25.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-25.js index 5086d5e504..dbfae2204e 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-25.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-25.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-25 description: > String.prototype.trim - argument 'this' is a decimal that converts to a string (value is 123.456) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(123.456) === "123.456"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(123.456), "123.456", 'String.prototype.trim.call(123.456)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-26.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-26.js index 36abc8ddde..4c9b973318 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-26.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-26.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-26 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 1(following 20 zeros).123) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(100000000000000000000.123) === "100000000000000000000"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(100000000000000000000.123), "100000000000000000000", 'String.prototype.trim.call(100000000000000000000.123)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-27.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-27.js index 81816c892a..3140ab3fec 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-27.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-27.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-27 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 123.1234567) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(123.1234567) === "123.1234567"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(123.1234567), "123.1234567", 'String.prototype.trim.call(123.1234567)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-28.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-28.js index bcdb567d1c..825b29355f 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-28.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-28.js @@ -4,10 +4,6 @@ /*--- es5id: 15.5.4.20-2-28 description: String.prototype.trim - argument 'this' is an empty string -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call("") === ""; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(""), "", 'String.prototype.trim.call("")'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-29.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-29.js index d88525bfa7..4562e8f0be 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-29.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-29.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-29 description: > String.prototype.trim - argument 'this' is a string(value is 'AB \cd') -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call("AB\n\\cd") === "AB\n\\cd"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call("AB\n\\cd"), "AB\n\\cd", 'String.prototype.trim.call("AB\n\\cd")'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-3.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-3.js index 44dafcfdf7..b2188b82f8 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-3.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-3.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-3 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is NaN) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(NaN) === "NaN"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(NaN), "NaN", 'String.prototype.trim.call(NaN)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-30.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-30.js index 26619f64b3..258a70c601 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-30.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-30.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-30 description: > String.prototype.trim - argument 'this' is a string(value is 'undefined') -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call("undefined") === "undefined"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call("undefined"), "undefined", 'String.prototype.trim.call("undefined")'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-31.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-31.js index bad3dfde1a..89c0ab51df 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-31.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-31.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-31 description: > String.prototype.trim - argument 'this' is a string(value is 'null') -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call("null") === "null"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call("null"), "null", 'String.prototype.trim.call("null")'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-32.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-32.js index 6c8fc7864b..7d2c6de184 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-32.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-32.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-32 description: > String.prototype.trim - argument 'this' is a string(value is '123#$%abc') -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call("123#$%abc") === "123#$%abc"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call("123#$%abc"), "123#$%abc", 'String.prototype.trim.call("123#$%abc")'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-33.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-33.js index 434b02015e..64fc61f7ec 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-33.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-33.js @@ -4,10 +4,6 @@ /*--- es5id: 15.5.4.20-2-33 description: String.prototype.trim - argument 'this' is a string(value is '1') -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call("1") === "1"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call("1"), "1", 'String.prototype.trim.call("1")'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-34.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-34.js index 10f9279cf1..b483e390d3 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-34.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-34.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-34 description: > String.prototype.trim - 'this' is an array that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { - return (String.prototype.trim.call([1]) === '1'); - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call([1]), '1', 'String.prototype.trim.call([1])'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-35.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-35.js index 13cdee1e19..93abde631a 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-35.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-35.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-35 description: > String.prototype.trim - 'this' is a String Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { - return (String.prototype.trim.call(new String("abc")) === "abc"); - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(new String("abc")), "abc", 'String.prototype.trim.call(new String("abc"))'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-36.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-36.js index 36e9f3bbea..df79aedac1 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-36.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-36.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-36 description: > String.prototype.trim - 'this' is a Boolean Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { - return (String.prototype.trim.call(new Boolean(false)) === "false"); - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(new Boolean(false)), "false", 'String.prototype.trim.call(new Boolean(false))'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-37.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-37.js index eda25f7b22..e2970253db 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-37.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-37.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-37 description: > String.prototype.trim - 'this' is a Number Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { - return (String.prototype.trim.call(new Number(123)) === "123"); - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(new Number(123)), "123", 'String.prototype.trim.call(new Number(123))'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-4.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-4.js index 66266ef532..a994d86d42 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-4.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-4.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-4 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(0) === "0"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(0), "0", 'String.prototype.trim.call(0)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-47.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-47.js index 2a65e07f04..55d3871c93 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-47.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-47.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-47 description: > String.prototype.trim - 'this' is a object Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call({}) === "[object Object]"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call({}), "[object Object]", 'String.prototype.trim.call({})'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-5.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-5.js index 799af8bce8..1776a50bce 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-5.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-5.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-5 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is +0) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(+0) === "0"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(+0), "0", 'String.prototype.trim.call(+0)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-6.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-6.js index 32c41fc783..a2a8b34357 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-6.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-6.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-6 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is -0) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(-0) === "0"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(-0), "0", 'String.prototype.trim.call(-0)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-7.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-7.js index f1c20a4d05..fd72a3e7cf 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-7.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-7.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-7 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is positive number) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(30) === "30"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(30), "30", 'String.prototype.trim.call(30)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-8.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-8.js index 88618a67d3..da0f732038 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-8.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-8.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-8 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is negative number) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(-20) === "-20"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(-20), "-20", 'String.prototype.trim.call(-20)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-9.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-9.js index 7deab2cd6f..f1607b830c 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-9.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-9.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-2-9 description: > String.prototype.trim - argument 'this' is a number that converts to a string (value is Infinity) -includes: [runTestCase.js] ---*/ -function testcase() { - return String.prototype.trim.call(Infinity) === "Infinity"; - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(Infinity), "Infinity", 'String.prototype.trim.call(Infinity)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-10.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-10.js index 14f0c06e4f..3ab1caa197 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-10.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-10.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-3-10 description: > String.prototype.trim - 'S' is a string with null character ('\u0000') -includes: [runTestCase.js] ---*/ -function testcase() { - return "\u0000".trim() === "\u0000"; - } -runTestCase(testcase); +assert.sameValue("\u0000".trim(), "\u0000", '"\u0000".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-11.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-11.js index bc09490b25..bbc4758b9b 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-11.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-11.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-3-11 description: > String.prototype.trim - 'S' is a string that starts with null character -includes: [runTestCase.js] ---*/ -function testcase() { - return "\0\u0000abc".trim() === "\0\u0000abc"; - } -runTestCase(testcase); +assert.sameValue("\0\u0000abc".trim(), "\0\u0000abc", '"\0\u0000abc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-12.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-12.js index c589b1c92d..8b4b66ca18 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-12.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-12.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-3-12 description: > String.prototype.trim - 'S' is a string that ends with null character -includes: [runTestCase.js] ---*/ -function testcase() { - return "abc\0\u0000".trim() === "abc\0\u0000"; - } -runTestCase(testcase); +assert.sameValue("abc\0\u0000".trim(), "abc\0\u0000", '"abc\0\u0000".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-13.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-13.js index e7e956610e..222c30fb53 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-13.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-13.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-3-13 description: > String.prototype.trim - 'S' is a string that starts with null character and ends with null character -includes: [runTestCase.js] ---*/ -function testcase() { - return "\0\u0000abc\0\u0000".trim() === "\0\u0000abc\0\u0000"; - } -runTestCase(testcase); +assert.sameValue("\0\u0000abc\0\u0000".trim(), "\0\u0000abc\0\u0000", '"\0\u0000abc\0\u0000".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-14.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-14.js index 28e139d06e..9d2833ac01 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-14.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-14.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-3-14 description: > String.prototype.trim - 'S' is a string that has null character in the middle -includes: [runTestCase.js] ---*/ -function testcase() { - return "a\0\u0000bc".trim() === "a\0\u0000bc"; - } -runTestCase(testcase); +assert.sameValue("a\0\u0000bc".trim(), "a\0\u0000bc", '"a\0\u0000bc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-8.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-8.js index ce52db7e3b..405cceddf9 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-8.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-8.js @@ -4,10 +4,6 @@ /*--- es5id: 15.5.4.20-3-8 description: String.prototype.trim - 'S' is a string with all null character -includes: [runTestCase.js] ---*/ -function testcase() { - return "\0\u0000".trim() === "\0\u0000"; - } -runTestCase(testcase); +assert.sameValue("\0\u0000".trim(), "\0\u0000", '"\0\u0000".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-9.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-9.js index 4492d2e89a..42b2e5a9e5 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-9.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-9.js @@ -4,10 +4,6 @@ /*--- es5id: 15.5.4.20-3-9 description: String.prototype.trim - 'S' is a string with null character ('\0') -includes: [runTestCase.js] ---*/ -function testcase() { - return "\0".trim() === "\0"; - } -runTestCase(testcase); +assert.sameValue("\0".trim(), "\0", '"\0".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-10.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-10.js index 9f38f7da90..94ece5e74a 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-10.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-10.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-4-10 description: > String.prototype.trim handles whitepace and lineterminators (\uFEFFabc) -includes: [runTestCase.js] ---*/ -function testcase() { - return "\uFEFFabc".trim() === "abc"; - } -runTestCase(testcase); +assert.sameValue("\uFEFFabc".trim(), "abc", '"\uFEFFabc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-18.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-18.js index 204514c06a..c40700eb8b 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-18.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-18.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-4-18 description: > String.prototype.trim handles whitepace and lineterminators (abc\uFEFF) -includes: [runTestCase.js] ---*/ -function testcase() { - return "abc\uFEFF".trim() === "abc"; - } -runTestCase(testcase); +assert.sameValue("abc\uFEFF".trim(), "abc", '"abc\uFEFF".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-34.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-34.js index c376b39cdc..7fd87790e2 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-34.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-34.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-4-34 description: > String.prototype.trim handles whitepace and lineterminators (\uFEFF\uFEFF) -includes: [runTestCase.js] ---*/ -function testcase() { - return "\uFEFF\uFEFF".trim() === ""; - } -runTestCase(testcase); +assert.sameValue("\uFEFF\uFEFF".trim(), "", '"\uFEFF\uFEFF".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-39.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-39.js index 345894f2af..bbe24258f8 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-39.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-39.js @@ -6,10 +6,6 @@ es5id: 15.5.4.20-4-39 description: > String.prototype.trim handles whitepace and lineterminators (ab\u0085c) -includes: [runTestCase.js] ---*/ -function testcase() { - return "ab\u0085c".trim() === "ab\u0085c"; - } -runTestCase(testcase); +assert.sameValue("ab\u0085c".trim(), "ab\u0085c", '"ab\u0085c".trim()'); diff --git a/test/built-ins/parseFloat/15.1.2.3-2-1.js b/test/built-ins/parseFloat/15.1.2.3-2-1.js index 856caddc39..ce12834c8f 100644 --- a/test/built-ins/parseFloat/15.1.2.3-2-1.js +++ b/test/built-ins/parseFloat/15.1.2.3-2-1.js @@ -6,10 +6,7 @@ es5id: 15.1.2.3-2-1 description: > pareseFloat - 'trimmedString' is the empty string when inputString does not contain any such characters -includes: [runTestCase.js] ---*/ -function testcase() { - return isNaN(parseFloat("")) && parseFloat("") !== parseFloat(""); - } -runTestCase(testcase); +assert(isNaN(parseFloat("")), 'isNaN(parseFloat("")) !== true'); +assert.sameValue(parseFloat(""), NaN, 'parseFloat("")'); diff --git a/test/built-ins/parseInt/15.1.2.2-2-1.js b/test/built-ins/parseInt/15.1.2.2-2-1.js index d34c54cddc..b87635ea9e 100644 --- a/test/built-ins/parseInt/15.1.2.2-2-1.js +++ b/test/built-ins/parseInt/15.1.2.2-2-1.js @@ -6,10 +6,7 @@ es5id: 15.1.2.2-2-1 description: > pareseInt - 'S' is the empty string when inputString does not contain any such characters -includes: [runTestCase.js] ---*/ -function testcase() { - return isNaN(parseInt("")) && parseInt("") !== parseInt(""); - } -runTestCase(testcase); +assert(isNaN(parseInt("")), 'isNaN(parseInt("")) !== true'); +assert.sameValue(parseInt(""), NaN, 'parseInt("")'); diff --git a/test/language/expressions/delete/11.4.1-2-1.js b/test/language/expressions/delete/11.4.1-2-1.js index 4d88210e5b..19a1de7fdd 100644 --- a/test/language/expressions/delete/11.4.1-2-1.js +++ b/test/language/expressions/delete/11.4.1-2-1.js @@ -4,13 +4,8 @@ /*--- es5id: 11.4.1-2-1 description: delete operator returns true when deleting a non-reference (number) -includes: [runTestCase.js] ---*/ -function testcase() { var d = delete 42; - if (d === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(d, true, 'd'); diff --git a/test/language/expressions/delete/11.4.1-4.a-17.js b/test/language/expressions/delete/11.4.1-4.a-17.js index b9a86cd8b0..6d441422e1 100644 --- a/test/language/expressions/delete/11.4.1-4.a-17.js +++ b/test/language/expressions/delete/11.4.1-4.a-17.js @@ -7,17 +7,12 @@ info: > language provides no way to directly exercise [[Delete]], the tests are placed here. es5id: 11.4.1-4.a-17 description: delete operator returns true on deleting a arguments element -includes: [runTestCase.js] ---*/ -function testcase() { function foo(a,b) { var d = delete arguments[0]; return (d === true && arguments[0] === undefined); } - if(foo(1,2) === true) - return true; - } -runTestCase(testcase); +assert.sameValue(foo(1,2), true, 'foo(1,2)'); diff --git a/test/language/expressions/unary-minus/11.4.7-4-1.js b/test/language/expressions/unary-minus/11.4.7-4-1.js index 170df2eebb..3c4f84373f 100644 --- a/test/language/expressions/unary-minus/11.4.7-4-1.js +++ b/test/language/expressions/unary-minus/11.4.7-4-1.js @@ -4,10 +4,6 @@ /*--- es5id: 11.4.7-4-1 description: -"" should be zero -includes: [runTestCase.js] ---*/ -function testcase() { - return -"" === 0; - } -runTestCase(testcase); +assert.sameValue(-"", -0, '-""'); diff --git a/test/language/expressions/unary-plus/11.4.6-2-1.js b/test/language/expressions/unary-plus/11.4.6-2-1.js index da6da3c7ab..d5ca55aea7 100644 --- a/test/language/expressions/unary-plus/11.4.6-2-1.js +++ b/test/language/expressions/unary-plus/11.4.6-2-1.js @@ -4,10 +4,6 @@ /*--- es5id: 11.4.6-2-1 description: +"" should be zero -includes: [runTestCase.js] ---*/ -function testcase() { - return +"" === 0; - } -runTestCase(testcase); +assert.sameValue(+"", 0, '+""'); From 4ec97779fdea46207c589dbe36f41785343a61a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 13 Aug 2015 17:56:55 +0200 Subject: [PATCH 2/2] Replace runTestCase with assert helpers, rest [test/built-ins] --- test/built-ins/Array/from/S22.1.2.1_T1.js | 9 +----- test/built-ins/Array/from/S22.1.2.1_T2.js | 10 +----- test/built-ins/Array/from/S22.1.2.1_T3.js | 10 +----- .../Array/prototype/every/15.4.4.16-4-10.js | 14 ++------ .../Array/prototype/every/15.4.4.16-4-11.js | 14 ++------ .../prototype/every/15.4.4.16-7-c-ii-7.js | 16 +++------- .../Array/prototype/filter/15.4.4.20-4-10.js | 14 ++------ .../Array/prototype/filter/15.4.4.20-4-11.js | 14 ++------ .../Array/prototype/filter/15.4.4.20-5-1.js | 9 +++--- .../Array/prototype/filter/15.4.4.20-9-3.js | 13 +++----- .../Array/prototype/filter/15.4.4.20-9-6.js | 13 +++----- .../prototype/filter/15.4.4.20-9-c-iii-1-2.js | 12 ++----- .../prototype/filter/15.4.4.20-9-c-iii-1-4.js | 13 ++------ .../prototype/filter/15.4.4.20-9-c-iii-1.js | 23 ++++++------- .../Array/prototype/forEach/15.4.4.18-4-10.js | 14 ++------ .../Array/prototype/forEach/15.4.4.18-4-11.js | 14 ++------ .../Array/prototype/forEach/15.4.4.18-5-1.js | 9 +++--- .../Array/prototype/indexOf/15.4.4.14-10-1.js | 32 +++++++------------ .../Array/prototype/indexOf/15.4.4.14-2-15.js | 21 +++--------- .../Array/prototype/indexOf/15.4.4.14-3-22.js | 15 +++------ .../Array/prototype/indexOf/15.4.4.14-5-1.js | 11 ++----- .../Array/prototype/indexOf/15.4.4.14-5-2.js | 13 +++----- .../Array/prototype/indexOf/15.4.4.14-5-24.js | 15 +++------ .../Array/prototype/indexOf/15.4.4.14-5-26.js | 12 ++----- .../Array/prototype/indexOf/15.4.4.14-5-27.js | 12 ++----- .../Array/prototype/indexOf/15.4.4.14-5-3.js | 11 ++----- .../Array/prototype/indexOf/15.4.4.14-5-4.js | 10 ++---- .../Array/prototype/indexOf/15.4.4.14-5-5.js | 10 ++---- .../Array/prototype/indexOf/15.4.4.14-9-1.js | 12 ++----- .../Array/prototype/indexOf/15.4.4.14-9-10.js | 10 ++---- .../Array/prototype/indexOf/15.4.4.14-9-2.js | 16 +++------- .../Array/prototype/indexOf/15.4.4.14-9-3.js | 10 ++---- .../Array/prototype/indexOf/15.4.4.14-9-4.js | 10 ++---- .../Array/prototype/indexOf/15.4.4.14-9-5.js | 10 ++---- .../Array/prototype/indexOf/15.4.4.14-9-6.js | 10 ++---- .../prototype/lastIndexOf/15.4.4.15-2-15.js | 21 +++--------- .../prototype/lastIndexOf/15.4.4.15-3-22.js | 15 +++------ .../prototype/lastIndexOf/15.4.4.15-3-28.js | 7 +--- .../prototype/lastIndexOf/15.4.4.15-5-1.js | 11 ++----- .../prototype/lastIndexOf/15.4.4.15-5-2.js | 13 +++----- .../prototype/lastIndexOf/15.4.4.15-5-24.js | 15 +++------ .../prototype/lastIndexOf/15.4.4.15-5-26.js | 13 ++------ .../prototype/lastIndexOf/15.4.4.15-5-27.js | 13 ++------ .../prototype/lastIndexOf/15.4.4.15-5-3.js | 11 ++----- .../prototype/lastIndexOf/15.4.4.15-5-4.js | 14 +++----- .../prototype/lastIndexOf/15.4.4.15-5-5.js | 11 +++---- .../prototype/lastIndexOf/15.4.4.15-5-7.js | 9 ++---- .../prototype/lastIndexOf/15.4.4.15-8-1.js | 12 ++----- .../prototype/lastIndexOf/15.4.4.15-8-10.js | 10 ++---- .../prototype/lastIndexOf/15.4.4.15-8-2.js | 16 +++------- .../lastIndexOf/15.4.4.15-8-b-i-27.js | 19 +++++------ .../prototype/lastIndexOf/15.4.4.15-9-1.js | 32 +++++++------------ .../Array/prototype/map/15.4.4.19-4-10.js | 14 ++------ .../Array/prototype/map/15.4.4.19-4-11.js | 14 ++------ .../prototype/map/15.4.4.19-8-c-iii-1.js | 23 ++++++------- .../prototype/map/15.4.4.19-8-c-iii-3.js | 12 ++----- .../prototype/map/15.4.4.19-8-c-iii-5.js | 13 ++------ .../Array/prototype/reduce/15.4.4.21-4-10.js | 14 ++------ .../Array/prototype/reduce/15.4.4.21-4-11.js | 14 ++------ .../Array/prototype/reduce/15.4.4.21-5-12.js | 14 ++------ .../Array/prototype/reduce/15.4.4.21-5-13.js | 15 ++------- .../Array/prototype/reduce/15.4.4.21-8-b-1.js | 14 +++----- .../Array/prototype/reduce/15.4.4.21-8-c-7.js | 14 ++------ .../Array/prototype/reduce/15.4.4.21-8-c-8.js | 14 ++------ .../Array/prototype/reduce/15.4.4.21-9-3.js | 11 ++----- .../Array/prototype/reduce/15.4.4.21-9-6.js | 10 ++---- .../prototype/reduceRight/15.4.4.22-4-10.js | 14 ++------ .../prototype/reduceRight/15.4.4.22-4-11.js | 14 ++------ .../prototype/reduceRight/15.4.4.22-5-12.js | 14 ++------ .../prototype/reduceRight/15.4.4.22-5-13.js | 14 ++------ .../prototype/reduceRight/15.4.4.22-8-b-1.js | 14 +++----- .../prototype/reduceRight/15.4.4.22-8-c-7.js | 14 ++------ .../prototype/reduceRight/15.4.4.22-8-c-8.js | 14 ++------ .../prototype/reduceRight/15.4.4.22-9-3.js | 11 ++----- .../prototype/reduceRight/15.4.4.22-9-6.js | 10 ++---- .../reduceRight/15.4.4.22-9-c-i-33.js | 16 +++------- .../reduceRight/15.4.4.22-9-c-ii-7.js | 16 +++------- .../Array/prototype/some/15.4.4.17-4-10.js | 14 ++------ .../Array/prototype/some/15.4.4.17-4-11.js | 14 ++------ .../Array/prototype/some/15.4.4.17-5-1.js | 9 +++--- .../prototype/toISOString/15.9.5.43-0-10.js | 13 ++------ .../prototype/toISOString/15.9.5.43-0-13.js | 13 ++------ .../prototype/toISOString/15.9.5.43-0-9.js | 13 ++------ .../Error/prototype/message/15.11.4.3-1.js | 9 +----- .../Error/prototype/name/15.11.4.2-1.js | 9 +----- test/built-ins/Function/15.3.2.1-11-2-s.js | 10 ------ test/built-ins/Function/15.3.2.1-11-4-s.js | 10 ------ test/built-ins/Function/15.3.2.1-11-6-s.js | 11 ------- test/built-ins/Function/15.3.2.1-11-7-s.js | 10 ------ .../Function/prototype/bind/15.3.4.5-2-16.js | 10 +----- .../Function/prototype/bind/15.3.4.5-20-2.js | 14 +++----- .../Function/prototype/bind/15.3.4.5-21-2.js | 14 +++----- test/built-ins/JSON/parse/15.12.1.1-0-1.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-0-2.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-0-3.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-0-4.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-0-5.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-0-6.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-0-7.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-0-8.js | 12 ++----- test/built-ins/JSON/parse/15.12.1.1-g1-1.js | 16 +++------- test/built-ins/JSON/parse/15.12.1.1-g1-2.js | 16 +++------- test/built-ins/JSON/parse/15.12.1.1-g1-3.js | 16 +++------- test/built-ins/JSON/parse/15.12.1.1-g1-4.js | 16 +++------- test/built-ins/JSON/parse/15.12.1.1-g2-2.js | 13 ++------ test/built-ins/JSON/parse/15.12.1.1-g2-3.js | 13 ++------ test/built-ins/JSON/parse/15.12.1.1-g2-4.js | 13 ++------ test/built-ins/JSON/parse/15.12.1.1-g4-1.js | 11 ++----- test/built-ins/JSON/parse/15.12.1.1-g4-2.js | 11 ++----- test/built-ins/JSON/parse/15.12.1.1-g4-3.js | 11 ++----- test/built-ins/JSON/parse/15.12.1.1-g4-4.js | 11 ++----- test/built-ins/JSON/parse/15.12.1.1-g5-2.js | 11 ++----- test/built-ins/JSON/parse/15.12.1.1-g5-3.js | 11 ++----- test/built-ins/JSON/parse/15.12.2-2-1.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-10.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-2.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-3.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-4.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-5.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-6.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-7.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-8.js | 15 ++------- test/built-ins/JSON/parse/15.12.2-2-9.js | 15 ++------- .../built-ins/JSON/stringify/15.12.3-6-b-1.js | 10 +++--- .../built-ins/JSON/stringify/15.12.3-6-b-2.js | 10 +++--- .../built-ins/JSON/stringify/15.12.3-6-b-3.js | 10 +++--- .../built-ins/JSON/stringify/15.12.3_4-1-1.js | 11 ++----- .../built-ins/JSON/stringify/15.12.3_4-1-2.js | 11 ++----- .../built-ins/JSON/stringify/15.12.3_4-1-3.js | 11 ++----- test/built-ins/Object/create/15.2.3.5-1-2.js | 9 ------ .../built-ins/Object/create/15.2.3.5-4-305.js | 12 ++----- .../built-ins/Object/create/15.2.3.5-4-306.js | 13 ++------ test/built-ins/Object/create/15.2.3.5-4-39.js | 10 +----- .../defineProperties/15.2.3.7-5-b-252.js | 13 ++------ .../defineProperties/15.2.3.7-6-a-155.js | 14 +++----- .../defineProperties/15.2.3.7-6-a-156.js | 15 +++------ .../defineProperties/15.2.3.7-6-a-159.js | 12 ++----- .../defineProperties/15.2.3.7-6-a-203.js | 9 +----- .../defineProperties/15.2.3.7-6-a-29.js | 9 +----- .../Object/defineProperty/15.2.3.6-4-116.js | 24 +++++++------- .../Object/defineProperty/15.2.3.6-4-163.js | 10 ------ .../Object/defineProperty/15.2.3.6-4-187.js | 9 ------ .../Object/defineProperty/15.2.3.6-4-2.js | 18 ++++------- .../Object/defineProperty/15.2.3.6-4-3.js | 15 +++------ .../Object/defineProperty/15.2.3.6-4-327.js | 14 ++++---- .../Object/defineProperty/15.2.3.6-4-334.js | 14 ++++---- .../Object/defineProperty/15.2.3.6-4-341.js | 12 +++---- .../Object/defineProperty/15.2.3.6-4-348.js | 12 +++---- .../Object/defineProperty/15.2.3.6-4-355.js | 14 ++++---- .../Object/defineProperty/15.2.3.6-4-362.js | 14 ++++---- .../Object/defineProperty/15.2.3.6-4-369.js | 12 +++---- .../Object/defineProperty/15.2.3.6-4-376.js | 12 +++---- .../Object/defineProperty/15.2.3.6-4-4.js | 15 +++------ .../Object/defineProperty/15.2.3.6-4-424.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-433.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-442.js | 11 ++----- .../Object/defineProperty/15.2.3.6-4-451.js | 11 ++----- .../Object/defineProperty/15.2.3.6-4-460.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-469.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-478.js | 11 ++----- .../Object/defineProperty/15.2.3.6-4-487.js | 11 ++----- .../Object/defineProperty/15.2.3.6-4-496.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-505.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-514.js | 11 ++----- .../Object/defineProperty/15.2.3.6-4-523.js | 11 ++----- .../Object/defineProperty/15.2.3.6-4-532.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-541.js | 13 ++++---- .../Object/defineProperty/15.2.3.6-4-550.js | 11 ++----- .../Object/defineProperty/15.2.3.6-4-559.js | 11 ++----- .../15.2.3.3-4-224.js | 11 ++----- .../15.2.3.3-4-226.js | 11 ++----- .../15.2.3.3-4-228.js | 11 ++----- .../15.2.3.3-4-230.js | 11 ++----- .../15.2.3.3-4-232.js | 11 ++----- .../15.2.3.3-4-234.js | 11 ++----- .../15.2.3.3-4-236.js | 11 ++----- .../15.2.3.3-4-238.js | 13 ++------ .../15.2.3.3-4-240.js | 11 ++----- .../15.2.3.3-4-242.js | 11 ++----- .../15.2.3.3-4-244.js | 11 ++----- .../15.2.3.3-4-246.js | 11 ++----- .../getOwnPropertyNames/15.2.3.4-4-1.js | 13 ++------ .../getOwnPropertyNames/15.2.3.4-4-36.js | 10 +----- .../getOwnPropertyNames/15.2.3.4-4-37.js | 9 +----- .../getOwnPropertyNames/15.2.3.4-4-40.js | 14 +------- .../getOwnPropertyNames/15.2.3.4-4-41.js | 13 +------- .../getOwnPropertyNames/15.2.3.4-4-42.js | 11 +++---- .../getOwnPropertyNames/15.2.3.4-4-43.js | 11 +++---- .../getOwnPropertyNames/15.2.3.4-4-45.js | 13 +------- .../getOwnPropertyNames/15.2.3.4-4-46.js | 13 +------- .../getOwnPropertyNames/15.2.3.4-4-47.js | 11 +++---- .../getOwnPropertyNames/15.2.3.4-4-48.js | 11 +++---- .../getOwnPropertyNames/15.2.3.4-4-b-3.js | 11 +++---- .../getOwnPropertyNames/15.2.3.4-4-b-4.js | 11 ++----- .../getOwnPropertyNames/15.2.3.4-4-b-5.js | 11 +++---- test/built-ins/Object/keys/15.2.3.14-3-5.js | 10 +++--- test/built-ins/Object/keys/15.2.3.14-5-10.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-11.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-12.js | 11 +++---- test/built-ins/Object/keys/15.2.3.14-5-13.js | 15 ++------- test/built-ins/Object/keys/15.2.3.14-5-14.js | 11 +++---- test/built-ins/Object/keys/15.2.3.14-5-15.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-16.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-3.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-4.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-5.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-6.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-7.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-8.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-9.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-5-a-2.js | 12 ++----- test/built-ins/Object/keys/15.2.3.14-5-b-1.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-6-1.js | 10 +----- test/built-ins/Object/keys/15.2.3.14-6-2.js | 9 +----- test/built-ins/Object/keys/15.2.3.14-6-3.js | 9 +----- test/built-ins/Object/keys/15.2.3.14-6-4.js | 9 +----- test/built-ins/Object/keys/15.2.3.14-6-5.js | 9 +----- test/built-ins/Object/keys/15.2.3.14-6-6.js | 12 ++----- test/built-ins/undefined/15.1.1.3-1.js | 15 +++------ 219 files changed, 695 insertions(+), 2057 deletions(-) diff --git a/test/built-ins/Array/from/S22.1.2.1_T1.js b/test/built-ins/Array/from/S22.1.2.1_T1.js index c35877b452..fd2320f76f 100644 --- a/test/built-ins/Array/from/S22.1.2.1_T1.js +++ b/test/built-ins/Array/from/S22.1.2.1_T1.js @@ -5,16 +5,9 @@ es6id: 22.1.2.1_T1 description: Testing Array.from when passed a String author: Hank Yates (hankyates@gmail.com) -includes: [runTestCase.js] ---*/ -runTestCase(function () { var arrLikeSource = 'testValue', testArr = Array.from(arrLikeSource); - if (testArr.length != 9) { - return false; - } - - return true; -}); +assert.sameValue(testArr.length, 9); diff --git a/test/built-ins/Array/from/S22.1.2.1_T2.js b/test/built-ins/Array/from/S22.1.2.1_T2.js index 827b00360f..138be8be03 100644 --- a/test/built-ins/Array/from/S22.1.2.1_T2.js +++ b/test/built-ins/Array/from/S22.1.2.1_T2.js @@ -5,10 +5,8 @@ es6id: 22.1.2.1_T2 description: Testing Array.from when passed an Object is passed author: Hank Yates (hankyates@gmail.com) -includes: [runTestCase.js] ---*/ -runTestCase(function () { var testArr = Array.from({ 'a': 1, 'b': '2', @@ -16,10 +14,4 @@ runTestCase(function () { 'length': '3' }); - if (testArr.length != 3) { - return false; - } - - return true; - -}); +assert.sameValue(testArr.length, 3); diff --git a/test/built-ins/Array/from/S22.1.2.1_T3.js b/test/built-ins/Array/from/S22.1.2.1_T3.js index 0299f36231..72e93ec539 100644 --- a/test/built-ins/Array/from/S22.1.2.1_T3.js +++ b/test/built-ins/Array/from/S22.1.2.1_T3.js @@ -5,16 +5,8 @@ es6id: 22.1.2.1_T3 description: Testing Array.from when passed an undefined author: Hank Yates (hankyates@gmail.com) -includes: [runTestCase.js] ---*/ -runTestCase(function () { - try { +assert.throws(TypeError, function() { Array.from(undefined); - } catch (e) { - return e instanceof TypeError; - } - - return false; - }); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js index 6bff09afc2..6e36f98564 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-10.js @@ -6,25 +6,17 @@ es5id: 15.4.4.16-4-10 description: > Array.prototype.every - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.every.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js index 6c5a71ec65..7f49c16a4e 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-4-11.js @@ -6,29 +6,21 @@ es5id: 15.4.4.16-4-11 description: > Array.prototype.every - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.every.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js index b81bc78d02..bba24bca1d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-ii-7.js @@ -6,28 +6,22 @@ es5id: 15.4.4.16-7-c-ii-7 description: > Array.prototype.every - unhandled exceptions happened in callbackfn terminate iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var called = 0; function callbackfn(val, idx, obj) { called++; if (called === 1) { - throw new Error("Exception occurred in callbackfn"); + throw new Test262Error("Exception occurred in callbackfn"); } return true; } var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; - try { +assert.throws(Test262Error, function() { Array.prototype.every.call(obj, callbackfn); - return false; - } catch (ex) { - return 1 === called; - } - } -runTestCase(testcase); +}); + +assert.sameValue(called, 1, 'called'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js index 702bdd445b..ce069c57a6 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-10.js @@ -6,25 +6,17 @@ es5id: 15.4.4.20-4-10 description: > Array.prototype.filter - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.filter.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js index 8964aa4fed..86e3eafc3d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-4-11.js @@ -6,29 +6,21 @@ es5id: 15.4.4.20-4-11 description: > Array.prototype.filter - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.filter.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js index f24da6d49c..741dabfb60 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-5-1.js @@ -5,10 +5,9 @@ es5id: 15.4.4.20-5-1 description: Array.prototype.filter - thisArg is passed flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { +(function() { this._15_4_4_20_5_1 = false; var _15_4_4_20_5_1 = true; @@ -17,6 +16,6 @@ function testcase() { } var srcArr = [1]; var resArr = srcArr.filter(callbackfn); - return resArr.length === 0; - } -runTestCase(testcase); + +assert.sameValue(resArr.length, 0, 'resArr.length'); +})(); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js index f660f7eb12..2e98c45afb 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-3 description: > Array.prototype.filter doesn't visit deleted elements in array after the call -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { delete srcArr[2]; @@ -23,8 +20,8 @@ function testcase() { var srcArr = [1,2,3,4,5]; var resArr = srcArr.filter(callbackfn); - if(resArr.length === 3 && resArr[0] === 1 && resArr[2] === 4 ) // two elements deleted - return true; - - } -runTestCase(testcase); + +// two elements deleted +assert.sameValue(resArr.length, 3, 'resArr.length'); +assert.sameValue(resArr[0], 1, 'resArr[0]'); +assert.sameValue(resArr[2], 4, 'resArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js index b22c278f16..6a4bfc3afa 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-6 description: > Array.prototype.filter visits deleted element in array after the call when same index is also present in prototype -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { delete srcArr[2]; @@ -25,8 +22,8 @@ function testcase() { var srcArr = [1,2,3,4,5]; var resArr = srcArr.filter(callbackfn); delete Array.prototype[4]; - if(resArr.length === 4 && resArr[0] === 1 && resArr[3] == 5) // only one element deleted - return true; - - } -runTestCase(testcase); + +// only one element deleted +assert.sameValue(resArr.length, 4, 'resArr.length'); +assert.sameValue(resArr[0], 1, 'resArr[0]'); +assert.sameValue(resArr[3], 5, 'resArr[3]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js index a71b2fee26..5038d64a96 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-2.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-1-2 description: > Array.prototype.filter - value of returned array element can be overwritten -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -18,12 +15,7 @@ function testcase() { var obj = { 0: 11, 1: 9, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - try { var tempVal = newArr[1]; newArr[1] += 1; - return newArr[1] !== tempVal; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert.notSameValue(newArr[1], tempVal, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js index 066cdba9a1..27a44717a4 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-1-4 description: > Array.prototype.filter - value of returned array element can be changed or deleted -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -18,12 +15,8 @@ function testcase() { var obj = { 0: 11, 1: 9, length: 2 }; var newArr = Array.prototype.filter.call(obj, callbackfn); - try { var tempVal = newArr[1]; delete newArr[1]; - return tempVal !== undefined && newArr[1] === undefined; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert.notSameValue(tempVal, undefined, 'tempVal'); +assert.sameValue(newArr[1], undefined, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js index d751645de3..b48d4970f3 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-iii-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-c-iii-1 description: > Array.prototype.filter - getOwnPropertyDescriptor(all true) of returned array element -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj){ if(val % 2) return true; @@ -19,14 +16,12 @@ function testcase() { } var srcArr = [0,1,2,3,4]; var resArr = srcArr.filter(callbackfn); - if (resArr.length > 0){ - var desc = Object.getOwnPropertyDescriptor(resArr, 1) - if(desc.value === 3 && //srcArr[1] = true - desc.writable === true && - desc.enumerable === true && - desc.configurable === true){ - return true; - } - } - } -runTestCase(testcase); + +assert(resArr.length > 0, 'resArr.length > 0'); + +var desc = Object.getOwnPropertyDescriptor(resArr, 1); + +assert.sameValue(desc.value, 3, 'desc.value'); //srcArr[1] = true +assert.sameValue(desc.writable, true, 'desc.writable'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js index 3f73a91503..1be5b6a0ed 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-10.js @@ -6,25 +6,17 @@ es5id: 15.4.4.18-4-10 description: > Array.prototype.forEach - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.forEach.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js index 9c2d162633..a033598f1e 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-4-11.js @@ -6,29 +6,21 @@ es5id: 15.4.4.18-4-11 description: > Array.prototype.forEach - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.forEach.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js index 500c57c373..80b584e9fc 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-5-1.js @@ -5,10 +5,9 @@ es5id: 15.4.4.18-5-1 description: Array.prototype.forEach - thisArg is passed flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { +(function() { this._15_4_4_18_5_1 = false; var _15_4_4_18_5_1 = true; var result; @@ -17,6 +16,6 @@ function testcase() { } var arr = [1]; arr.forEach(callbackfn) - return !result; - } -runTestCase(testcase); + +assert.sameValue(result, false, 'result'); +})(); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js index e4021265a4..f3cea59e84 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-10-1.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-10-1 description: > Array.prototype.indexOf returns -1 for elements not present in array -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(); a[100] = 1; a[99999] = ""; @@ -17,21 +15,15 @@ function testcase() { a[5555] = 5.5; a[123456] = "str"; a[5] = 1E+309; - if (a.indexOf(1) !== 100 || - a.indexOf("") !== 99999 || - a.indexOf("str") !== 123456 || - a.indexOf(1E+309) !== 5 || //Infinity - a.indexOf(5.5) !== 5555 ) - { - return false; - } - if (a.indexOf(true) === -1 && - a.indexOf(5) === -1 && - a.indexOf("str1") === -1 && - a.indexOf(null) === -1 && - a.indexOf(new Object()) === -1) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(1), 100, 'a.indexOf(1)'); +assert.sameValue(a.indexOf(""), 99999, 'a.indexOf("")'); +assert.sameValue(a.indexOf("str"), 123456, 'a.indexOf("str")'); +assert.sameValue(a.indexOf(1E+309), 5, 'a.indexOf(1E+309)'); //Infinity +assert.sameValue(a.indexOf(5.5), 5555, 'a.indexOf(5.5)'); + +assert.sameValue(a.indexOf(true), -1, 'a.indexOf(true)'); +assert.sameValue(a.indexOf(5), -1, 'a.indexOf(5)'); +assert.sameValue(a.indexOf("str1"), -1, 'a.indexOf("str1")'); +assert.sameValue(a.indexOf(null), -1, 'a.indexOf(null)'); +assert.sameValue(a.indexOf(new Object()), -1, 'a.indexOf(new Object())'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-15.js index c192a52a80..5ccbbf084a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-15.js @@ -4,30 +4,19 @@ /*--- es5id: 15.4.4.14-2-15 description: Array.prototype.indexOf - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var targetObj = {}; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject().length = 2; fnGlobalObject()[1] = targetObj; - if (Array.prototype.indexOf.call(fnGlobalObject(), targetObj) !== 1) { - return false; - } + +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), targetObj), 1, 'Array.prototype.indexOf.call(fnGlobalObject(), targetObj)'); fnGlobalObject()[1] = {}; fnGlobalObject()[2] = targetObj; - return Array.prototype.indexOf.call(fnGlobalObject(), targetObj) === -1; - } finally { - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), targetObj), -1, 'Array.prototype.indexOf.call(fnGlobalObject(), targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js index 836185e205..8c37bec86c 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var toStringAccessed = false; var valueOfAccessed = false; @@ -29,11 +26,9 @@ function testcase() { } }; - try { +assert.throws(TypeError, function() { Array.prototype.indexOf.call(obj); - return false; - } catch (e) { - return toStringAccessed && valueOfAccessed; - } - } -runTestCase(testcase); +}); + +assert(toStringAccessed, 'toStringAccessed'); +assert(valueOfAccessed, 'valueOfAccessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js index d56c7c1b89..4159d5b916 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-1.js @@ -4,14 +4,9 @@ /*--- es5id: 15.4.4.14-5-1 description: Array.prototype.indexOf when fromIndex is string -includes: [runTestCase.js] ---*/ -function testcase() { var a = [1,2,1,2,1,2]; - if (a.indexOf(2,"2") === 3 && // "2" resolves to 2 - a.indexOf(2,"one") === 1) { // "one" resolves to 0 - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(2,"2"), 3, '"2" resolves to 2'); +assert.sameValue(a.indexOf(2,"one"), 1, '"one" resolves to 0'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js index 96daf206f7..40c7dac876 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-2.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.14-5-2 description: Array.prototype.indexOf when fromIndex is floating point number -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,3); - if (a.indexOf(3,0.49) === 2 && // 0.49 resolves to 0 - a.indexOf(1,0.51) === 0 && // 0.51 resolves to 0 - a.indexOf(1,1.51) === -1) { // 1.01 resolves to 1 - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(3,0.49), 2, '0.49 resolves to 0'); +assert.sameValue(a.indexOf(1,0.51), 0, '0.51 resolves to 0'); +assert.sameValue(a.indexOf(1,1.51), -1, '1.51 resolves to 1'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js index bb3f7774d0..a414dc1223 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-24.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf throws TypeError exception when value of 'fromIndex' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var toStringAccessed = false; var valueOfAccessed = false; var fromIndex = { @@ -26,11 +23,9 @@ function testcase() { } }; - try { +assert.throws(TypeError, function() { [0, true].indexOf(true, fromIndex); - return false; - } catch (e) { - return toStringAccessed && valueOfAccessed; - } - } -runTestCase(testcase); +}); + +assert(toStringAccessed, 'toStringAccessed'); +assert(valueOfAccessed, 'valueOfAccessed'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js index 1d52bad079..de49b58374 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-26.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-5-26 description: > Array.prototype.indexOf - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { var stepTwoOccurs = false; var stepFiveOccurs = false; @@ -33,11 +31,7 @@ function testcase() { } }; - try { Array.prototype.indexOf.call(obj, undefined, fromIndex); - return stepTwoOccurs && stepFiveOccurs; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert(stepTwoOccurs, 'stepTwoOccurs !== true'); +assert(stepFiveOccurs, 'stepFiveOccurs !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js index b48daf47e2..e09ca58572 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-27.js @@ -6,10 +6,8 @@ es5id: 15.4.4.14-5-27 description: > Array.prototype.indexOf - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { var stepThreeOccurs = false; var stepFiveOccurs = false; @@ -37,11 +35,7 @@ function testcase() { } }; - try { Array.prototype.indexOf.call(obj, undefined, fromIndex); - return stepThreeOccurs && stepFiveOccurs; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert(stepThreeOccurs, 'stepThreeOccurs !== true'); +assert(stepFiveOccurs, 'stepFiveOccurs !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js index 540410d8a2..07634100d2 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-3.js @@ -4,14 +4,9 @@ /*--- es5id: 15.4.4.14-5-3 description: Array.prototype.indexOf when fromIndex is boolean -includes: [runTestCase.js] ---*/ -function testcase() { var a = [1,2,3]; - if (a.indexOf(1,true) === -1 && // true resolves to 1 - a.indexOf(1,false) === 0 ) { // false resolves to 0 - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(1,true), -1, 'true resolves to 1'); +assert.sameValue(a.indexOf(1,false), 0, 'false resolves to 0'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js index 92c6e45196..53a914ea26 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-4.js @@ -4,13 +4,9 @@ /*--- es5id: 15.4.4.14-5-4 description: Array.prototype.indexOf returns 0 if fromIndex is 'undefined' -includes: [runTestCase.js] ---*/ -function testcase() { var a = [1,2,3]; - if (a.indexOf(1,undefined) === 0) { // undefined resolves to 0 - return true; - } - } -runTestCase(testcase); + +// undefined resolves to 0 +assert.sameValue(a.indexOf(1,undefined), 0, 'a.indexOf(1,undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js index e35c5d3476..c3bdaaa833 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-5-5.js @@ -4,13 +4,9 @@ /*--- es5id: 15.4.4.14-5-5 description: Array.prototype.indexOf returns 0 if fromIndex is null -includes: [runTestCase.js] ---*/ -function testcase() { var a = [1,2,3]; - if (a.indexOf(1,null) === 0 ) { // null resolves to 0 - return true; - } - } -runTestCase(testcase); + +// null resolves to 0 +assert.sameValue(a.indexOf(1,null), 0, 'a.indexOf(1,null)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js index 8f480f2dca..fd75573cff 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-1.js @@ -4,17 +4,11 @@ /*--- es5id: 15.4.4.14-9-1 description: Array.prototype.indexOf must return correct index (boolean) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return true}}; var _false = false; var a = [obj,"true", undefined,0,_false,null,1,"str",0,1,true,false,true,false]; - if (a.indexOf(true) === 10 && //a[10]=true - a.indexOf(false) === 4) //a[4] =_false - { - return true; - } - } -runTestCase(testcase); + + assert.sameValue(a.indexOf(true), 10, 'a[10]=true'); + assert.sameValue(a.indexOf(false), 4, 'a[4] =_false'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js index 41d62527c7..ec885dadd9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-10.js @@ -7,15 +7,9 @@ info: > and hence NaNs could be found using indexOf * es5id: 15.4.4.14-9-10 description: Array.prototype.indexOf must return correct index (NaN) -includes: [runTestCase.js] ---*/ -function testcase() { var _NaN = NaN; var a = new Array("NaN",undefined,0,false,null,{toString:function (){return NaN}},"false",_NaN,NaN); - if (a.indexOf(NaN) === -1) // NaN is equal to nothing, including itself. - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(NaN), -1, 'NaN is equal to nothing, including itself.'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js index 1a9195d833..a6f57a9a12 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-2.js @@ -4,20 +4,14 @@ /*--- es5id: 15.4.4.14-9-2 description: Array.prototype.indexOf must return correct index (Number) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return 0}}; var one = 1; var _float = -(4/3); var a = new Array(false,undefined,null,"0",obj,-1.3333333333333, "str",-0,true,+0, one, 1,0, false, _float, -(4/3)); - if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) - a.indexOf(0) === 7 && // a[7] = +0, 0===+0 - a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 - a.indexOf(1) === 10 ) // a[10] =one=== 1 - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(-(4/3)), 14, 'a[14]=_float===-(4/3)'); +assert.sameValue(a.indexOf(0), 7, 'a[7] = +0, 0===+0'); +assert.sameValue(a.indexOf(-0), 7, 'a[7] = +0, -0===+0'); +assert.sameValue(a.indexOf(1), 10, 'a[10] =one=== 1'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js index a128354411..7fbb3f76c1 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-3.js @@ -4,16 +4,10 @@ /*--- es5id: 15.4.4.14-9-3 description: Array.prototype.indexOf must return correct index(string) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return "false"}}; var szFalse = "false"; var a = new Array("false1",undefined,0,false,null,1,obj,0,szFalse, "false"); - if (a.indexOf("false") === 8) //a[8]=szFalse - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf("false"), 8, 'a[8]=szFalse'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js index dc31bba673..79c1bfbdc5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-4.js @@ -4,17 +4,11 @@ /*--- es5id: 15.4.4.14-9-4 description: Array.prototype.indexOf 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(true,0,false,null,1,"undefined",obj,1,_undefined2,_undefined1,undefined); - if (a.indexOf(undefined) === 8) //a[8]=_undefined2 - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(undefined), 8, 'a[8]=_undefined2'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js index 4129a36d2b..770a1e61ae 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-5.js @@ -4,17 +4,11 @@ /*--- es5id: 15.4.4.14-9-5 description: Array.prototype.indexOf 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(false,undefined,0,false,null,{toString:function (){return "false"}},"false",obj2,obj1,obj3); - if (a.indexOf(obj3) === 8) //a[8] = obj1; - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(obj3), 8, 'a[8] = obj1'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js index 1a30df03e5..2723ca3b5e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-6.js @@ -4,16 +4,10 @@ /*--- es5id: 15.4.4.14-9-6 description: Array.prototype.indexOf 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,obj,true,false,null); - if (a.indexOf(null) === 4 ) //a[4]=_null - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.indexOf(null), 4, 'a[4]=_null'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-15.js index 50f4d6bae1..c6e5c55e52 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-15.js @@ -6,30 +6,19 @@ es5id: 15.4.4.15-2-15 description: > Array.prototype.lastIndexOf - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var targetObj = {}; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject().length = 2; fnGlobalObject()[1] = targetObj; - if (Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj) !== 1) { - return false; - } + +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 1); fnGlobalObject()[1] = {}; fnGlobalObject()[2] = targetObj; - return Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj) === -1; - } finally { - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), -1); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js index 0d3e63509e..859db8d19c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-22.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf throws TypeError exception when 'length' is an object with toString and valueOf methods that don�t return primitive values -includes: [runTestCase.js] ---*/ -function testcase() { - var toStringAccessed = false; var valueOfAccessed = false; @@ -30,11 +27,9 @@ function testcase() { } }; - try { +assert.throws(TypeError, function() { Array.prototype.lastIndexOf.call(obj, true); - return false; - } catch (e) { - return toStringAccessed && valueOfAccessed; - } - } -runTestCase(testcase); +}); + +assert(toStringAccessed, 'toStringAccessed'); +assert(valueOfAccessed, 'valueOfAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js index 15dbb8f1b3..f5e6829a46 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-3-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-3-28 description: > Array.prototype.lastIndexOf - value of 'length' is boundary value (2^32) -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = {}; var obj = { 0: targetObj, @@ -19,6 +16,4 @@ function testcase() { length: 4294967296 }; - return Array.prototype.lastIndexOf.call(obj, targetObj) === 4294967295; //verify length is 4294967296 finally - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, targetObj), 4294967295, 'verify length is 4294967296 finally'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js index a151520a9f..0b38e59b11 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-1.js @@ -4,14 +4,9 @@ /*--- es5id: 15.4.4.15-5-1 description: Array.prototype.lastIndexOf when fromIndex is string -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(0,1,1); - if (a.lastIndexOf(1,"1") === 1 && // "1" resolves to 1 - a.lastIndexOf(1,"one") === -1) { // NaN string resolves to 0 - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(1,"1"), 1, '"1" resolves to 1'); +assert.sameValue(a.lastIndexOf(1,"one"), -1, 'NaN string resolves to 01'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js index 68ba3657c3..aba55fc82b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-2.js @@ -4,15 +4,10 @@ /*--- es5id: 15.4.4.15-5-2 description: Array.prototype.lastIndexOf when fromIndex is floating point number -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,1); - if (a.lastIndexOf(2,1.49) === 1 && // 1.49 resolves to 1 - a.lastIndexOf(2,0.51) === -1 && // 0.51 resolves to 0 - a.lastIndexOf(1,0.51) === 0){ // 0.51 resolves to 0 - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(2,1.49), 1, '1.49 resolves to 1'); +assert.sameValue(a.lastIndexOf(2,0.51), -1, '0.51 resolves to 0'); +assert.sameValue(a.lastIndexOf(1,0.51), 0, '0.51 resolves to 0'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js index e2c7c4964d..b67e73d4e2 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-24.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf throws TypeError exception when value of 'fromIndex' is an object that both toString and valueOf methods than don't return primitive value -includes: [runTestCase.js] ---*/ -function testcase() { - var toStringAccessed = false; var valueOfAccessed = false; @@ -27,11 +24,9 @@ function testcase() { } }; - try { +assert.throws(TypeError, function() { [0, null].lastIndexOf(null, fromIndex); - return false; - } catch (e) { - return toStringAccessed && valueOfAccessed; - } - } -runTestCase(testcase); +}); + +assert(toStringAccessed, 'toStringAccessed'); +assert(valueOfAccessed, 'valueOfAccessed'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js index 276d540c75..b46e57f36d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-26.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-5-26 description: > Array.prototype.lastIndexOf - side effects produced by step 2 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepTwoOccurs = false; var stepFiveOccurs = false; var obj = {}; @@ -33,11 +30,7 @@ function testcase() { } }; - try { Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); - return stepTwoOccurs && stepFiveOccurs; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert(stepTwoOccurs, 'stepTwoOccurs !== true'); +assert(stepFiveOccurs, 'stepFiveOccurs !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js index 838f3d003a..79d50042f8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-27.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-5-27 description: > Array.prototype.lastIndexOf - side effects produced by step 3 are visible when an exception occurs -includes: [runTestCase.js] ---*/ -function testcase() { - var stepThreeOccurs = false; var stepFiveOccurs = false; @@ -38,11 +35,7 @@ function testcase() { } }; - try { Array.prototype.lastIndexOf.call(obj, undefined, fromIndex); - return stepThreeOccurs && stepFiveOccurs; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert(stepThreeOccurs, 'stepThreeOccurs !== true'); +assert(stepFiveOccurs, 'stepFiveOccurs !== true'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js index df0c430016..8f17e00a5c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-3.js @@ -4,14 +4,9 @@ /*--- es5id: 15.4.4.15-5-3 description: Array.prototype.lastIndexOf when fromIndex is boolean -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,1); - if (a.lastIndexOf(2,true) === 1 && // true resolves to 1 - a.lastIndexOf(2,false) === -1 ) { // false resolves to 0 - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(2,true), 1, 'true resolves to 1'); +assert.sameValue(a.lastIndexOf(2,false), -1, 'false resolves to 0'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js index 8f41d59c03..3dca6d6f93 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-4.js @@ -4,15 +4,11 @@ /*--- es5id: 15.4.4.15-5-4 description: Array.prototype.lastIndexOf when fromIndex is undefined -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,1); - if (a.lastIndexOf(2,undefined) === -1 && - a.lastIndexOf(1,undefined) === 0 && - a.lastIndexOf(1) === 2) { // undefined resolves to 0, no second argument resolves to len - return true; - } - } -runTestCase(testcase); + +// undefined resolves to 0, no second argument resolves to len +assert.sameValue(a.lastIndexOf(2,undefined), -1, 'a.lastIndexOf(2,undefined)'); +assert.sameValue(a.lastIndexOf(1,undefined), 0, 'a.lastIndexOf(1,undefined)'); +assert.sameValue(a.lastIndexOf(1), 2, 'a.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js index 1417d08aa1..0b3066dd78 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-5.js @@ -4,13 +4,10 @@ /*--- es5id: 15.4.4.15-5-5 description: Array.prototype.lastIndexOf when fromIndex is null -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(1,2,1); - if (a.lastIndexOf(2,null) === -1 && a.lastIndexOf(1,null) === 0) { // null resolves to 0 - return true; - } - } -runTestCase(testcase); + +// null resolves to 0 +assert.sameValue(a.lastIndexOf(2,null), -1, 'a.lastIndexOf(2,null)'); +assert.sameValue(a.lastIndexOf(1,null), 0, 'a.lastIndexOf(1,null)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-7.js index 621c9d9a99..c5ff0e677d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-5-7.js @@ -6,12 +6,7 @@ es5id: 15.4.4.15-5-7 description: > Array.prototype.lastIndexOf - value of 'fromIndex' is a number (value is 0) -includes: [runTestCase.js] ---*/ -function testcase() { - - return [0, 100].lastIndexOf(100, 0) === -1 && // verify fromIndex is not more than 0 - [200, 0].lastIndexOf(200, 0) === 0; // verify fromIndex is not less than 0 - } -runTestCase(testcase); +assert.sameValue([0, 100].lastIndexOf(100, 0), -1, 'verify fromIndex is not more than 0'); +assert.sameValue([200, 0].lastIndexOf(200, 0), 0, 'verify fromIndex is not less than 0'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js index 2aa7289550..4bd0f4d094 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-1.js @@ -4,17 +4,11 @@ /*--- es5id: 15.4.4.15-8-1 description: Array.prototype.lastIndexOf must return correct index(boolean) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return true}}; var _false = false; var a = new Array(false,true,false,obj,_false,true,"true", undefined,0,null,1,"str",0,1); - if (a.lastIndexOf(true) === 5 && //a[5]=true - a.lastIndexOf(false) === 4) //a[4] =_false - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(true), 5, 'a[5]=true'); +assert.sameValue(a.lastIndexOf(false), 4, 'a[4] =_false'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js index fa3db84c62..fdeb4532e1 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-10.js @@ -7,15 +7,9 @@ info: > and hence NaNs could be found using lastIndexOf * es5id: 15.4.4.15-8-10 description: Array.prototype.lastIndexOf must return correct index (NaN) -includes: [runTestCase.js] ---*/ -function testcase() { var _NaN = NaN; var a = new Array("NaN",_NaN,NaN, undefined,0,false,null,{toString:function (){return NaN}},"false"); - if (a.lastIndexOf(NaN) === -1) // NaN matches nothing, not even itself - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(NaN), -1, 'NaN matches nothing, not even itself'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js index e749deb93a..680c9db64b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-2.js @@ -4,20 +4,14 @@ /*--- es5id: 15.4.4.15-8-2 description: Array.prototype.lastIndexOf must return correct index(Number) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {toString:function (){return 0}}; var one = 1; var _float = -(4/3); var a = new Array(+0,true,0,-0, false,undefined,null,"0",obj, _float,-(4/3),-1.3333333333333,"str",one, 1, false); - if (a.lastIndexOf(-(4/3)) === 10 && // a[10]=-(4/3) - a.lastIndexOf(0) === 3 && // a[3] = -0, but using === -0 and 0 are equal - a.lastIndexOf(-0) ===3 && // a[3] = -0 - a.lastIndexOf(1) === 14 ) // a[14] = 1 - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(-(4/3)), 10, 'a[10]=-(4/3)'); +assert.sameValue(a.lastIndexOf(0), 3, 'a[3] = -0, but using === -0 and 0 are equal'); +assert.sameValue(a.lastIndexOf(-0), 3, 'a[3] = -0'); +assert.sameValue(a.lastIndexOf(1), 14, 'a[14] = 1'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js index f28fa9d063..b43f2cc476 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-27.js @@ -7,17 +7,14 @@ description: > Array.prototype.lastIndexOf applied to Arguments object which implements its own property get method (number of arguments is greater than number of parameters) -includes: [runTestCase.js] ---*/ -function testcase() { +var func = function (a, b) { + assert.sameValue(Array.prototype.lastIndexOf.call(arguments, arguments[0]), 2); + assert.sameValue(Array.prototype.lastIndexOf.call(arguments, arguments[3]), 3); + assert.sameValue(Array.prototype.lastIndexOf.call(arguments, arguments[4]), -1); +}; - var func = function (a, b) { - return 2 === Array.prototype.lastIndexOf.call(arguments, arguments[0]) && - 3 === Array.prototype.lastIndexOf.call(arguments, arguments[3]) && - -1 === Array.prototype.lastIndexOf.call(arguments, arguments[4]); - }; - - return func(0, arguments, 0, Object.prototype); - } -runTestCase(testcase); +(function() { + func(0, arguments, 0, Object.prototype); +})(); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js index 56e8f61498..c23ef0dd52 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-9-1.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.15-9-1 description: Array.prototype.lastIndexOf returns -1 for elements not present -includes: [runTestCase.js] ---*/ -function testcase() { var a = new Array(); a[100] = 1; a[99999] = ""; @@ -15,21 +13,15 @@ function testcase() { a[5555] = 5.5; a[123456] = "str"; a[5] = 1E+309; - if (a.lastIndexOf(1) !== 100 || - a.lastIndexOf("") !== 99999 || - a.lastIndexOf("str") !== 123456 || - a.lastIndexOf(5.5) !== 5555 || - a.lastIndexOf(1E+309) !== 5 ) - { - return false; - } - if (a.lastIndexOf(true) === -1 && - a.lastIndexOf(5) === -1 && - a.lastIndexOf("str1") === -1 && - a.lastIndexOf(null) === -1 && - a.lastIndexOf(new Object()) === -1 ) - { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(a.lastIndexOf(1), 100, 'a.lastIndexOf(1)'); +assert.sameValue(a.lastIndexOf(""), 99999, 'a.lastIndexOf("")'); +assert.sameValue(a.lastIndexOf("str"), 123456, 'a.lastIndexOf("str")'); +assert.sameValue(a.lastIndexOf(5.5), 5555, 'a.lastIndexOf(5.5)'); +assert.sameValue(a.lastIndexOf(1E+309), 5, 'a.lastIndexOf(1E+309)'); + +assert.sameValue(a.lastIndexOf(true), -1, 'a.lastIndexOf(true)'); +assert.sameValue(a.lastIndexOf(5), -1, 'a.lastIndexOf(5)'); +assert.sameValue(a.lastIndexOf("str1"), -1, 'a.lastIndexOf("str1")'); +assert.sameValue(a.lastIndexOf(null), -1, 'a.lastIndexOf(null)'); +assert.sameValue(a.lastIndexOf(new Object()), -1, 'a.lastIndexOf(new Object())'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js index e6a8836578..f68465873e 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-10.js @@ -6,25 +6,17 @@ es5id: 15.4.4.19-4-10 description: > Array.prototype.map - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.map.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js index 8ebf4a8be1..1c7334a52b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-4-11.js @@ -6,29 +6,21 @@ es5id: 15.4.4.19-4-11 description: > Array.prototype.map - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.map.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js index 6aa15e999c..75cb39c703 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-1.js @@ -6,10 +6,7 @@ es5id: 15.4.4.19-8-c-iii-1 description: > Array.prototype.map - getOwnPropertyDescriptor(all true) of returned array element -includes: [runTestCase.js] ---*/ - -function testcase() { function callbackfn(val, idx, obj){ if(val % 2) @@ -19,14 +16,12 @@ function testcase() { } var srcArr = [0,1,2,3,4]; var resArr = srcArr.map(callbackfn); - if (resArr.length > 0){ - var desc = Object.getOwnPropertyDescriptor(resArr, 1) - if(desc.value === 3 && //srcArr[1] = 2*1+1 = 3 - desc.writable === true && - desc.enumerable === true && - desc.configurable === true){ - return true; - } - } - } -runTestCase(testcase); + +assert(resArr.length > 0, 'resArr.length > 0'); + +var desc = Object.getOwnPropertyDescriptor(resArr, 1); + +assert.sameValue(desc.value, 3, 'desc.value'); //srcArr[1] = 2*1+1 = 3 +assert.sameValue(desc.writable, true, 'desc.writable'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js index 622ff378b3..5dd26a8fde 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-iii-3 description: > Array.prototype.map - value of returned array element can be overwritten -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return 11; } @@ -18,12 +15,7 @@ function testcase() { var obj = { 0: 11, 1: 9, length: 2 }; var newArr = Array.prototype.map.call(obj, callbackfn); - try { var tempVal = newArr[1]; newArr[1] += 1; - return newArr[1] !== tempVal; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert.notSameValue(newArr[1], tempVal, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js index 2d04906b55..bd70709ddb 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-iii-5.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-iii-5 description: > Array.prototype.map - value of returned array element can be changed or deleted -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -18,12 +15,8 @@ function testcase() { var obj = { 0: 11, 1: 9, length: 2 }; var newArr = Array.prototype.map.call(obj, callbackfn); - try { var tempVal = newArr[1]; delete newArr[1]; - return tempVal !== undefined && newArr[1] === undefined; - } catch (ex) { - return false; - } - } -runTestCase(testcase); + +assert.notSameValue(tempVal, undefined, 'tempVal'); +assert.sameValue(newArr[1], undefined, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js index 20e18205ed..5b665af154 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-10.js @@ -6,25 +6,17 @@ es5id: 15.4.4.21-4-10 description: > Array.prototype.reduce - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduce.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js index 2b77f84c09..3c6dce4a67 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-4-11.js @@ -6,29 +6,21 @@ es5id: 15.4.4.21-4-11 description: > Array.prototype.reduce - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduce.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js index 8b1dbfc22e..8228c57d2e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-5-12 description: > Array.prototype.reduce - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal > 10); } @@ -19,16 +16,11 @@ function testcase() { Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduce.call(obj, callbackfn); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js index 09e5772075..f2b22add7f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-5-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-5-13 description: > Array.prototype.reduce - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (curVal > 10); } @@ -21,19 +18,13 @@ function testcase() { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - - try { +assert.throws(Test262Error, function() { Array.prototype.reduce.call(obj, callbackfn); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js index 911f588e6f..453ce6bf41 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-1.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.21-8-b-1 description: Array.prototype.reduce - no observable effects occur if 'len' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var obj = { length: 0 }; @@ -21,11 +18,8 @@ function testcase() { configurable: true }); - try { +assert.throws(TypeError, function() { Array.prototype.reduce.call(obj, function () { }); - return false; - } catch (ex) { - return !accessed; - } - } -runTestCase(testcase); +}); + +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js index 084a2c0494..a74acf7bd6 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-7.js @@ -6,25 +6,17 @@ es5id: 15.4.4.21-8-c-7 description: > Array.prototype.reduce - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduce.call(obj, function () { }); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js index 019b6eddf5..6895790620 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-8.js @@ -6,29 +6,21 @@ es5id: 15.4.4.21-8-c-8 description: > Array.prototype.reduce - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduce.call(obj, function () { }); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js index 0270290120..b92e59ff2c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-3 description: > Array.prototype.reduce doesn't visit deleted elements in array after the call -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { delete arr[3]; @@ -19,8 +16,6 @@ function testcase() { } var arr = ['1',2,3,4,5]; - if(arr.reduce(callbackfn) === "123" ) // two elements deleted - return true; - - } -runTestCase(testcase); + +// two elements deleted +assert.sameValue(arr.reduce(callbackfn), "123", 'arr.reduce(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js index aa3c35f047..709c1db2fe 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-6 description: > Array.prototype.reduce visits deleted element in array after the call when same index is also present in prototype -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { delete arr[3]; @@ -23,8 +20,5 @@ function testcase() { var res = arr.reduce(callbackfn); delete Array.prototype[4]; - if(res === "1235" ) //one element acually deleted - return true; - - } -runTestCase(testcase); +//one element acually deleted +assert.sameValue(res, "1235", 'res'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js index b19c529f7d..fe98b763d8 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-10.js @@ -6,25 +6,17 @@ es5id: 15.4.4.22-4-10 description: > Array.prototype.reduceRight - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduceRight.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js index 3927b9dd60..49a1c44b7c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-4-11.js @@ -6,29 +6,21 @@ es5id: 15.4.4.22-4-11 description: > Array.prototype.reduceRight - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduceRight.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js index 113fa40974..84adaf4ef7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-12.js @@ -6,25 +6,17 @@ es5id: 15.4.4.22-5-12 description: > Array.prototype.reduceRight - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js index 4f5873aaa3..d0f06ac910 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-5-13.js @@ -6,29 +6,21 @@ es5id: 15.4.4.22-5-13 description: > Array.prototype.reduceRight - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js index 646150b2b2..ac7c7dd056 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-1 description: > Array.prototype.reduceRight - no observable effects occur if 'len' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var obj = { length: 0 }; @@ -23,11 +20,8 @@ function testcase() { configurable: true }); - try { +assert.throws(TypeError, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return !accessed; - } - } -runTestCase(testcase); +}); + +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js index 7c9c24c94c..f5a7c93c35 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-7.js @@ -6,25 +6,17 @@ es5id: 15.4.4.22-8-c-7 description: > Array.prototype.reduceRight - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js index c83379d5d5..d049897bdd 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-8.js @@ -6,29 +6,21 @@ es5id: 15.4.4.22-8-c-8 description: > Array.prototype.reduceRight - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = {}; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.reduceRight.call(obj, function () { }); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js index eafe439e87..e7e827c77f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-3.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-3 description: > Array.prototype.reduceRight doesn't consider unvisited deleted elements in array after the call -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { delete arr[1]; @@ -19,8 +16,6 @@ function testcase() { } var arr = ['1',2,3,4,5]; - if(arr.reduceRight(callbackfn) === "121" ) // two elements deleted - return true; - - } -runTestCase(testcase); + +// two elements deleted +assert.sameValue(arr.reduceRight(callbackfn), "121", 'arr.reduceRight(callbackfn)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js index 435f5ebc9a..dccd40ec58 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-6 description: > Array.prototype.reduceRight visits deleted element in array after the call when same index is also present in prototype -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { delete arr[1]; @@ -22,8 +19,5 @@ function testcase() { var res = arr.reduceRight(callbackfn); delete Array.prototype[2]; - if(res === "151" ) //one element deleted - return true; - - } -runTestCase(testcase); +//one element deleted +assert.sameValue(res, "151", 'res'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js index 6eeac93a3f..3e31b8ffa5 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-33.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-33 description: > Array.prototype.reduceRight - unnhandled exceptions happened in getter terminate iteration on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx <= 1) { @@ -22,16 +19,13 @@ function testcase() { Object.defineProperty(arr, "1", { get: function () { - throw new RangeError("unhandle exception happened in getter"); + throw new Test262Error("unhandle exception happened in getter"); }, configurable: true }); - try { +assert.throws(Test262Error, function() { arr.reduceRight(callbackfn, "initialValue"); - return true; - } catch (ex) { - return (ex instanceof RangeError) && !accessed; - } - } -runTestCase(testcase); +}); + +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js index 8315b75cea..f4d88297ed 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-ii-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-ii-7 description: > Array.prototype.reduceRight - unhandled exceptions happened in callbackfn terminate iteration -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -18,17 +15,14 @@ function testcase() { accessed = true; } if (idx === 10) { - throw new Error("Exception occurred in callbackfn"); + throw new Test262Error("Exception occurred in callbackfn"); } } var obj = { 0: 11, 4: 10, 10: 8, length: 20 }; - try { +assert.throws(Test262Error, function() { Array.prototype.reduceRight.call(obj, callbackfn, 1); - return false; - } catch (ex) { - return !accessed; - } - } -runTestCase(testcase); +}); + +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js index 4b27b4d5c3..e20cbf01c7 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-10.js @@ -6,25 +6,17 @@ es5id: 15.4.4.17-4-10 description: > Array.prototype.some - the exception is not thrown if exception was thrown by step 2 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { - throw new SyntaxError(); + throw new Test262Error(); }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.some.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js index dd5b4e379a..2d8747ff58 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-4-11.js @@ -6,29 +6,21 @@ es5id: 15.4.4.17-4-11 description: > Array.prototype.some - the exception is not thrown if exception was thrown by step 3 -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { 0: 11, 1: 12 }; Object.defineProperty(obj, "length", { get: function () { return { toString: function () { - throw new SyntaxError(); + throw new Test262Error(); } }; }, configurable: true }); - try { +assert.throws(Test262Error, function() { Array.prototype.some.call(obj, undefined); - return false; - } catch (ex) { - return !(ex instanceof TypeError); - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js index 6a72406c29..b33dd69f2a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-5-1.js @@ -5,10 +5,9 @@ es5id: 15.4.4.17-5-1 description: Array.prototype.some - thisArg is passed flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { +(function() { this._15_4_4_17_5_1 = false; var _15_4_4_17_5_1 = true; @@ -16,6 +15,6 @@ function testcase() { return this._15_4_4_17_5_1; } var arr = [1]; - return !arr.some(callbackfn); - } -runTestCase(testcase); + +assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); +})(); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-10.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-10.js index c26fdbbe43..bb2f0c928c 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-10.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-10.js @@ -7,28 +7,21 @@ description: > Date.prototype.toISOString - RangeError is not thrown when value of date is Date(1970, 0, -99999999, 0, 0, 0, 1), the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var timeZoneMinutes = new Date().getTimezoneOffset() * (-1); var date, dateStr; if (timeZoneMinutes > 0) { date = new Date(1970, 0, -99999999, 0, 0, 0, 1); - try { + assert.throws(RangeError, function() { date.toISOString(); - return false; - } catch (e) { - return e instanceof RangeError; - } + }); } else { date = new Date(1970, 0, -99999999, 0, 0 + timeZoneMinutes + 60, 0, 1); dateStr = date.toISOString(); - return dateStr[dateStr.length - 1] === "Z"; + assert.sameValue(dateStr[dateStr.length - 1], "Z"); } - } -runTestCase(testcase); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-13.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-13.js index 86882fa91b..5840e5daaa 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-13.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-13.js @@ -7,24 +7,17 @@ description: > Date.prototype.toISOString - RangeError is thrown when value of date is Date(1970, 0, 100000001, 0, 0, 0, 1), the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var timeZoneMinutes = new Date().getTimezoneOffset() * (-1); var date, dateStr; - try { + +assert.throws(RangeError, function() { if (timeZoneMinutes > 0) { date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes + 60, 0, 1); dateStr = date.toISOString(); - return false; } else { date = new Date(1970, 0, 100000001, 0, 0, 0, 1); dateStr = date.toISOString(); - return false; } - } catch (e) { - return e instanceof RangeError; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-9.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-9.js index 4b4cd380c7..966c2575d2 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-9.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-9.js @@ -7,28 +7,21 @@ description: > Date.prototype.toISOString - RangeError is not thrown when value of date is Date(1970, 0, -99999999, 0, 0, 0, 0), the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var timeZoneMinutes = new Date().getTimezoneOffset() * (-1); var date, dateStr; if (timeZoneMinutes > 0) { date = new Date(1970, 0, -99999999, 0, 0, 0, 0); - try { + assert.throws(RangeError, function() { date.toISOString(); - return false; - } catch (e) { - return e instanceof RangeError; - } + }); } else { date = new Date(1970, 0, -99999999, 0, 0 + timeZoneMinutes + 60, 0, 0); dateStr = date.toISOString(); - return dateStr[dateStr.length - 1] === "Z"; + assert.sameValue(dateStr[dateStr.length - 1], "Z"); } - } -runTestCase(testcase); diff --git a/test/built-ins/Error/prototype/message/15.11.4.3-1.js b/test/built-ins/Error/prototype/message/15.11.4.3-1.js index 862334e058..6860135a9f 100644 --- a/test/built-ins/Error/prototype/message/15.11.4.3-1.js +++ b/test/built-ins/Error/prototype/message/15.11.4.3-1.js @@ -4,15 +4,8 @@ /*--- es5id: 15.11.4.3-1 description: Error.prototype.message is not enumerable. -includes: [runTestCase.js] ---*/ -function testcase() { for (var i in Error.prototype) { - if (i==="message") { - return false; - } + assert.notSameValue(i, "message", 'i'); } - return true; -} -runTestCase(testcase); diff --git a/test/built-ins/Error/prototype/name/15.11.4.2-1.js b/test/built-ins/Error/prototype/name/15.11.4.2-1.js index f8aeabc757..7df0656c17 100644 --- a/test/built-ins/Error/prototype/name/15.11.4.2-1.js +++ b/test/built-ins/Error/prototype/name/15.11.4.2-1.js @@ -4,15 +4,8 @@ /*--- es5id: 15.11.4.2-1 description: Error.prototype.name is not enumerable. -includes: [runTestCase.js] ---*/ -function testcase() { for (var i in Error.prototype) { - if (i==="name") { - return false; - } + assert.notSameValue(i, "name", 'i'); } - return true; -} -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-2-s.js b/test/built-ins/Function/15.3.2.1-11-2-s.js index ca72758c8e..7f670f1477 100644 --- a/test/built-ins/Function/15.3.2.1-11-2-s.js +++ b/test/built-ins/Function/15.3.2.1-11-2-s.js @@ -7,16 +7,6 @@ description: > Duplicate seperate parameter name in Function constructor called from strict mode allowed if body not strict flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() -{ - try { Function('a','a','return;'); - return true; - } catch (e) { - return false; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-4-s.js b/test/built-ins/Function/15.3.2.1-11-4-s.js index 86cd60f4a5..858a9d7ac9 100644 --- a/test/built-ins/Function/15.3.2.1-11-4-s.js +++ b/test/built-ins/Function/15.3.2.1-11-4-s.js @@ -8,16 +8,6 @@ description: > named 'eval' does not throws SyntaxError if function body is not strict mode flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - try { Function('eval', 'return;'); - return true; - } catch (e) { - return false; - } - - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-6-s.js b/test/built-ins/Function/15.3.2.1-11-6-s.js index d5bb334607..5d5362cbb8 100644 --- a/test/built-ins/Function/15.3.2.1-11-6-s.js +++ b/test/built-ins/Function/15.3.2.1-11-6-s.js @@ -7,17 +7,6 @@ description: > Duplicate combined parameter name allowed in Function constructor called in strict mode if body not strict flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() -{ - try { Function('a,a','return a;'); - return true; - } catch (e) { - return false; - } - - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-7-s.js b/test/built-ins/Function/15.3.2.1-11-7-s.js index 22b70f0f6e..dd1d6e55ad 100644 --- a/test/built-ins/Function/15.3.2.1-11-7-s.js +++ b/test/built-ins/Function/15.3.2.1-11-7-s.js @@ -8,16 +8,6 @@ description: > named arguments does not throws SyntaxError if function body is not strict mode flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - try { Function('arguments', 'return;'); - return true; - - } catch (e) { - return false; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-16.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-16.js index 198888297b..4d72a31fe1 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-16.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-16.js @@ -4,16 +4,8 @@ /*--- es5id: 15.3.4.5-2-16 description: Function.prototype.bind - 'Target' is a function -includes: [runTestCase.js] ---*/ -function testcase() { function testFunc() {} - try { + testFunc.bind(); - return true; - } catch (e) { - return false; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-20-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-20-2.js index 0504fb6ce1..c07b78a052 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-20-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-20-2.js @@ -6,17 +6,11 @@ es5id: 15.3.4.5-20-2 description: > Function.prototype.bind - [[Get]] attribute of 'caller' property in 'F' is thrower -includes: [runTestCase.js] ---*/ -function testcase() { - function foo() { } var obj = foo.bind({}); - try { - return obj.caller && false; - } catch (ex) { - return (ex instanceof TypeError); - } - } -runTestCase(testcase); + +assert.throws(TypeError, function() { + obj.caller; +}); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-21-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-21-2.js index 376124ecb4..8779bc06da 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-21-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-21-2.js @@ -6,17 +6,11 @@ es5id: 15.3.4.5-21-2 description: > Function.prototype.bind - [[Get]] attribute of 'arguments' property in 'F' is thrower -includes: [runTestCase.js] ---*/ -function testcase() { - function foo() { } var obj = foo.bind({}); - try { - return obj.arguments && false; - } catch (ex) { - return (ex instanceof TypeError); - } - } -runTestCase(testcase); + +assert.throws(TypeError, function() { + obj.arguments; +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-1.js b/test/built-ins/JSON/parse/15.12.1.1-0-1.js index 003fcf02fa..d1bb9eecd0 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-1.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-1.js @@ -4,16 +4,8 @@ /*--- es5id: 15.12.1.1-0-1 description: The JSON lexical grammar treats whitespace as a token seperator -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { JSON.parse('12\t\r\n 34'); // should produce a syntax error as whitespace results in two tokens - } - catch (e) { - if (e.name === 'SyntaxError') return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-2.js b/test/built-ins/JSON/parse/15.12.1.1-0-2.js index 76e5cd1799..8254a4d62a 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-2.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-2.js @@ -6,16 +6,8 @@ es5id: 15.12.1.1-0-2 description: > is not valid JSON whitespace as specified by the production JSONWhitespace. -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { JSON.parse('\u000b1234'); // should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-3.js b/test/built-ins/JSON/parse/15.12.1.1-0-3.js index 38c7b69470..fb213cb00d 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-3.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-3.js @@ -6,16 +6,8 @@ es5id: 15.12.1.1-0-3 description: > is not valid JSON whitespace as specified by the production JSONWhitespace. -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { JSON.parse('\u000c1234'); // should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-4.js b/test/built-ins/JSON/parse/15.12.1.1-0-4.js index 6a7d75a213..34b31816c9 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-4.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-4.js @@ -6,16 +6,8 @@ es5id: 15.12.1.1-0-4 description: > is not valid JSON whitespace as specified by the production JSONWhitespace. -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { JSON.parse('\u00a01234'); // should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-5.js b/test/built-ins/JSON/parse/15.12.1.1-0-5.js index 0655622a1c..e18222fd23 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-5.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-5.js @@ -6,16 +6,8 @@ es5id: 15.12.1.1-0-5 description: > is not valid JSON whitespace as specified by the production JSONWhitespace. -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { JSON.parse('\u200b1234'); // should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-6.js b/test/built-ins/JSON/parse/15.12.1.1-0-6.js index eb0a10a950..cfaf7d0505 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-6.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-6.js @@ -6,16 +6,8 @@ es5id: 15.12.1.1-0-6 description: > is not valid JSON whitespace as specified by the production JSONWhitespace. -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { JSON.parse('\ufeff1234'); // should produce a syntax error a - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-7.js b/test/built-ins/JSON/parse/15.12.1.1-0-7.js index 25aee06eb8..25e408786b 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-7.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-7.js @@ -6,17 +6,9 @@ es5id: 15.12.1.1-0-7 description: > other category z spaces are not valid JSON whitespace as specified by the production JSONWhitespace. -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { // the following should produce a syntax error JSON.parse('\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u30001234'); - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-8.js b/test/built-ins/JSON/parse/15.12.1.1-0-8.js index 6b1d7360f6..fa7bb87b3d 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-8.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-8.js @@ -6,16 +6,8 @@ es5id: 15.12.1.1-0-8 description: > U+2028 and U+2029 are not valid JSON whitespace as specified by the production JSONWhitespace. -includes: [runTestCase.js] ---*/ -function testcase() { - - try { +assert.throws(SyntaxError, function() { JSON.parse('\u2028\u20291234'); // should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g1-1.js b/test/built-ins/JSON/parse/15.12.1.1-g1-1.js index 9cc442b585..4325a2899d 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g1-1.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g1-1.js @@ -4,16 +4,10 @@ /*--- es5id: 15.12.1.1-g1-1 description: The JSON lexical grammar treats as a whitespace character -includes: [runTestCase.js] ---*/ -function testcase() { - if (JSON.parse('\t1234')!==1234) return false; // should be ignored - try { - JSON.parse('12\t34'); // should produce a syntax error as whitespace results in two tokens - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +assert.sameValue(JSON.parse('\t1234'), 1234, ' should be ignored'); + +assert.throws(SyntaxError, function() { + JSON.parse('12\t34'); +}, ' should produce a syntax error as whitespace results in two tokens'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g1-2.js b/test/built-ins/JSON/parse/15.12.1.1-g1-2.js index aa1f04d21f..4c71c01a76 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g1-2.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g1-2.js @@ -4,16 +4,10 @@ /*--- es5id: 15.12.1.1-g1-2 description: The JSON lexical grammar treats as a whitespace character -includes: [runTestCase.js] ---*/ -function testcase() { - if (JSON.parse('\r1234')!==1234) return false; // should be ignored - try { - JSON.parse('12\r34'); // should produce a syntax error as whitespace results in two tokens - } - catch (e) { - if (e.name === 'SyntaxError') return true; - } - } -runTestCase(testcase); +assert.sameValue(JSON.parse('\r1234'), 1234, ' should be ignored'); + +assert.throws(SyntaxError, function() { + JSON.parse('12\r34'); +}, ' should produce a syntax error as whitespace results in two tokens'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g1-3.js b/test/built-ins/JSON/parse/15.12.1.1-g1-3.js index 8e30dac0ae..80e533c416 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g1-3.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g1-3.js @@ -4,16 +4,10 @@ /*--- es5id: 15.12.1.1-g1-3 description: The JSON lexical grammar treats as a whitespace character -includes: [runTestCase.js] ---*/ -function testcase() { - if (JSON.parse('\n1234')!==1234) return false; // should be ignored - try { - JSON.parse('12\n34'); // should produce a syntax error as whitespace results in two tokens - } - catch (e) { - if (e.name === 'SyntaxError') return true; - } - } -runTestCase(testcase); +assert.sameValue(JSON.parse('\n1234'), 1234, ' should be ignored'); + +assert.throws(SyntaxError, function() { + JSON.parse('12\n34'); +}, ' should produce a syntax error as whitespace results in two tokens'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g1-4.js b/test/built-ins/JSON/parse/15.12.1.1-g1-4.js index 3b1494c0ec..b00e82b558 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g1-4.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g1-4.js @@ -4,16 +4,10 @@ /*--- es5id: 15.12.1.1-g1-4 description: The JSON lexical grammar treats as a whitespace character -includes: [runTestCase.js] ---*/ -function testcase() { - if (JSON.parse(' 1234')!=1234) return false; // should be ignored - try { - JSON.parse('12 34'); // should produce a syntax error as whitespace results in two tokens - } - catch (e) { - if (e.name === 'SyntaxError') return true; - } - } -runTestCase(testcase); +assert.sameValue(JSON.parse(' 1234'), 1234, ' should be ignored'); + +assert.throws(SyntaxError, function() { + JSON.parse('12 34'); +}, ' should produce a syntax error as whitespace results in two tokens'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g2-2.js b/test/built-ins/JSON/parse/15.12.1.1-g2-2.js index 4e5be737a5..dcef87ac52 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g2-2.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g2-2.js @@ -4,15 +4,8 @@ /*--- es5id: 15.12.1.1-g2-2 description: A JSONString may not be delimited by single quotes -includes: [runTestCase.js] ---*/ -function testcase() { - try { - if (JSON.parse("'abc'") ==='abc') return false; - } - catch (e) { - return true; - } - } -runTestCase(testcase); +assert.throws(SyntaxError, function() { + JSON.parse("'abc'"); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g2-3.js b/test/built-ins/JSON/parse/15.12.1.1-g2-3.js index 93c6de5a3f..4809d42250 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g2-3.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g2-3.js @@ -4,15 +4,8 @@ /*--- es5id: 15.12.1.1-g2-3 description: A JSONString may not be delimited by Uncode escaped quotes -includes: [runTestCase.js] ---*/ -function testcase() { - try { - if (JSON.parse("\\u0022abc\\u0022") ==='abc') return false; - } - catch (e) { - return true; - } - } -runTestCase(testcase); +assert.throws(SyntaxError, function() { + JSON.parse("\\u0022abc\\u0022"); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g2-4.js b/test/built-ins/JSON/parse/15.12.1.1-g2-4.js index 54492523d1..cf4a5d47f1 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g2-4.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g2-4.js @@ -4,15 +4,8 @@ /*--- es5id: 15.12.1.1-g2-4 description: A JSONString must both begin and end with double quotes -includes: [runTestCase.js] ---*/ -function testcase() { - try { - if (JSON.parse('"ab'+"c'") ==='abc') return false; - } - catch (e) { - return true; - } - } -runTestCase(testcase); +assert.throws(SyntaxError, function() { + JSON.parse('"ab'+"c'"); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g4-1.js b/test/built-ins/JSON/parse/15.12.1.1-g4-1.js index 2bcfc01e81..d7b8a45848 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g4-1.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g4-1.js @@ -6,15 +6,8 @@ es5id: 15.12.1.1-g4-1 description: > The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0000 thru U+0007 -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(SyntaxError, function() { JSON.parse('"\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007"'); // invalid string characters should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g4-2.js b/test/built-ins/JSON/parse/15.12.1.1-g4-2.js index 44ae7812ff..5022dcbca3 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g4-2.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g4-2.js @@ -6,15 +6,8 @@ es5id: 15.12.1.1-g4-2 description: > The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0008 thru U+000F -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(SyntaxError, function() { JSON.parse('"\u0008\u0009\u000a\u000b\u000c\u000d\u000e\u000f"'); // invalid string characters should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g4-3.js b/test/built-ins/JSON/parse/15.12.1.1-g4-3.js index fa298dce2b..9d13dbb696 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g4-3.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g4-3.js @@ -6,15 +6,8 @@ es5id: 15.12.1.1-g4-3 description: > The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0010 thru U+0017 -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(SyntaxError, function() { JSON.parse('"\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"'); // invalid string characters should produce a syntax error - } - catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g4-4.js b/test/built-ins/JSON/parse/15.12.1.1-g4-4.js index 0370960f47..e222184eb6 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g4-4.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g4-4.js @@ -6,15 +6,8 @@ es5id: 15.12.1.1-g4-4 description: > The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0018 thru U+001F -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(SyntaxError, function() { JSON.parse('"\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f"'); // invalid string characters should produce a syntax error - } - catch (e) { - if (e.name === 'SyntaxError') return true; - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g5-2.js b/test/built-ins/JSON/parse/15.12.1.1-g5-2.js index 8d0a1c0533..d03a299208 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g5-2.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g5-2.js @@ -6,15 +6,8 @@ es5id: 15.12.1.1-g5-2 description: > A JSONStringCharacter UnicodeEscape may not have fewer than 4 hex characters -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(SyntaxError, function() { JSON.parse('"\\u005"') - } - catch (e) { - return e.name==='SyntaxError' - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.1.1-g5-3.js b/test/built-ins/JSON/parse/15.12.1.1-g5-3.js index 7ed0b8e894..e577bd6f60 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-g5-3.js +++ b/test/built-ins/JSON/parse/15.12.1.1-g5-3.js @@ -6,15 +6,8 @@ es5id: 15.12.1.1-g5-3 description: > A JSONStringCharacter UnicodeEscape may not include any non=hex characters -includes: [runTestCase.js] ---*/ -function testcase() { - try { +assert.throws(SyntaxError, function() { JSON.parse('"\\u0X50"') - } - catch (e) { - return e.name==='SyntaxError' - } - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/parse/15.12.2-2-1.js b/test/built-ins/JSON/parse/15.12.2-2-1.js index c2b3a57317..a2a42946f1 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-1.js +++ b/test/built-ins/JSON/parse/15.12.2-2-1.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-1 description: > JSON.parse - parsing an object where property name is a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ ' + nullChars[index] + ' : "John" } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-10.js b/test/built-ins/JSON/parse/15.12.2-2-10.js index ef0291f48e..0f3c73ac11 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-10.js +++ b/test/built-ins/JSON/parse/15.12.2-2-10.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-10 description: > JSON.parse - parsing an object where property value middles with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ "name" : ' + "Jo" + nullChars[index] + "hn" + ' } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-2.js b/test/built-ins/JSON/parse/15.12.2-2-2.js index 9be1f9711a..d577d5b76b 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-2.js +++ b/test/built-ins/JSON/parse/15.12.2-2-2.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-2 description: > JSON.parse - parsing an object where property name starts with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ ' + nullChars[index] + "name" + ' : "John" } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-3.js b/test/built-ins/JSON/parse/15.12.2-2-3.js index 524b8badd1..20f19e1b2c 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-3.js +++ b/test/built-ins/JSON/parse/15.12.2-2-3.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-3 description: > JSON.parse - parsing an object where property name ends with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{' + "name" + nullChars[index] + ' : "John" } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-4.js b/test/built-ins/JSON/parse/15.12.2-2-4.js index dc1d6654e3..755f4578f8 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-4.js +++ b/test/built-ins/JSON/parse/15.12.2-2-4.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-4 description: > JSON.parse - parsing an object where property name starts and ends with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{' + nullChars[index] + "name" + nullChars[index] + ' : "John" } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-5.js b/test/built-ins/JSON/parse/15.12.2-2-5.js index f2149cbd81..1b0a6240bb 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-5.js +++ b/test/built-ins/JSON/parse/15.12.2-2-5.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-5 description: > JSON.parse - parsing an object where property name middles with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ ' + "na" + nullChars[index] + "me" + ' : "John" } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-6.js b/test/built-ins/JSON/parse/15.12.2-2-6.js index dd2e2e7a0b..c4fb8b863c 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-6.js +++ b/test/built-ins/JSON/parse/15.12.2-2-6.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-6 description: > JSON.parse - parsing an object where property value is a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ "name" : ' + nullChars[index] + ' } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-7.js b/test/built-ins/JSON/parse/15.12.2-2-7.js index 6612ec0162..2cb912b1fa 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-7.js +++ b/test/built-ins/JSON/parse/15.12.2-2-7.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-7 description: > JSON.parse - parsing an object where property value starts with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ "name" : ' + nullChars[index] + "John" + ' } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-8.js b/test/built-ins/JSON/parse/15.12.2-2-8.js index 2d4feb42c8..ab571c59f0 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-8.js +++ b/test/built-ins/JSON/parse/15.12.2-2-8.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-8 description: > JSON.parse - parsing an object where property value ends with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ "name" : ' + "John" + nullChars[index] + ' } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-2-9.js b/test/built-ins/JSON/parse/15.12.2-2-9.js index cbd697bf64..ab7ca39ccd 100644 --- a/test/built-ins/JSON/parse/15.12.2-2-9.js +++ b/test/built-ins/JSON/parse/15.12.2-2-9.js @@ -6,13 +6,8 @@ es5id: 15.12.2-2-9 description: > JSON.parse - parsing an object where property value starts and ends with a null character -includes: [runTestCase.js] ---*/ -function testcase() { - - var result = true; - var nullChars = new Array(); nullChars[0] = '\"\u0000\"'; nullChars[1] = '\"\u0001\"'; @@ -48,13 +43,7 @@ function testcase() { nullChars[31] = '\"\u001F\"'; for (var index in nullChars) { - try { + assert.throws(SyntaxError, function() { var obj = JSON.parse('{ "name" : ' + nullChars[index] + "John" + nullChars[index] + ' } '); - result = (result && false); - } catch (e) { - result = (result && (e instanceof SyntaxError)); - } + }); } - return result; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-1.js b/test/built-ins/JSON/stringify/15.12.3-6-b-1.js index d6d96ff336..d5eea1024f 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-1.js @@ -5,12 +5,10 @@ es5id: 15.12.3-6-b-1 description: > JSON.stringify treats numeric space arguments less than 1 - (0.999999)the same as emptry string space argument. -includes: [runTestCase.js] + (0.999999)the same as empty string space argument. ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, 0.999999)=== JSON.stringify(obj); /* emptry string should be same as no space arg */ - } -runTestCase(testcase); + +/* empty string should be same as no space arg */ +assert.sameValue(JSON.stringify(obj,null, 0.999999), JSON.stringify(obj)); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-2.js b/test/built-ins/JSON/stringify/15.12.3-6-b-2.js index 925f41bc31..d1bf8401b2 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-2.js @@ -5,12 +5,10 @@ es5id: 15.12.3-6-b-2 description: > JSON.stringify treats numeric space arguments less than 1 (0)the - same as emptry string space argument. -includes: [runTestCase.js] + same as empty string space argument. ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, 0)=== JSON.stringify(obj); /* emptry string should be same as no space arg */ - } -runTestCase(testcase); + +/* empty string should be same as no space arg */ +assert.sameValue(JSON.stringify(obj,null, 0), JSON.stringify(obj)); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-3.js b/test/built-ins/JSON/stringify/15.12.3-6-b-3.js index 97a087a43b..9310f9470b 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-3.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-3.js @@ -5,12 +5,10 @@ es5id: 15.12.3-6-b-3 description: > JSON.stringify treats numeric space arguments less than 1 (-5) the - same as emptry string space argument. -includes: [runTestCase.js] + same as empty string space argument. ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, -5)=== JSON.stringify(obj); /* emptry string should be same as no space arg */ - } -runTestCase(testcase); + + /* empty string should be same as no space arg */ + assert.sameValue(JSON.stringify(obj,null, -5), JSON.stringify(obj)); diff --git a/test/built-ins/JSON/stringify/15.12.3_4-1-1.js b/test/built-ins/JSON/stringify/15.12.3_4-1-1.js index fc6dd799ce..f9b5f68ab3 100644 --- a/test/built-ins/JSON/stringify/15.12.3_4-1-1.js +++ b/test/built-ins/JSON/stringify/15.12.3_4-1-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.12.3_4-1-1 description: JSON.stringify a circular object throws a error -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; obj.prop = obj; - try { + +assert.throws(TypeError, function() { JSON.stringify(obj); - return false; // should not reach here - } - catch (e) {return true} - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/stringify/15.12.3_4-1-2.js b/test/built-ins/JSON/stringify/15.12.3_4-1-2.js index 9a960b0075..a79907bd0f 100644 --- a/test/built-ins/JSON/stringify/15.12.3_4-1-2.js +++ b/test/built-ins/JSON/stringify/15.12.3_4-1-2.js @@ -4,16 +4,11 @@ /*--- es5id: 15.12.3_4-1-2 description: JSON.stringify a circular object throws a TypeError -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; obj.prop = obj; - try { + +assert.throws(TypeError, function() { JSON.stringify(obj); - return false; // should not reach here - } - catch (e) {return e.name==='TypeError'} - } -runTestCase(testcase); +}); diff --git a/test/built-ins/JSON/stringify/15.12.3_4-1-3.js b/test/built-ins/JSON/stringify/15.12.3_4-1-3.js index e772cddfdf..30d0a4339c 100644 --- a/test/built-ins/JSON/stringify/15.12.3_4-1-3.js +++ b/test/built-ins/JSON/stringify/15.12.3_4-1-3.js @@ -4,16 +4,11 @@ /*--- es5id: 15.12.3_4-1-3 description: JSON.stringify a indirectly circular object throws a error -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {p1: {p2: {}}}; obj.p1.p2.prop = obj; - try { + +assert.throws(TypeError, function() { JSON.stringify(obj); - return false; // should not reach here - } - catch (e) {return true} - } -runTestCase(testcase); +}); diff --git a/test/built-ins/Object/create/15.2.3.5-1-2.js b/test/built-ins/Object/create/15.2.3.5-1-2.js index 38cccf56ff..36226f322a 100644 --- a/test/built-ins/Object/create/15.2.3.5-1-2.js +++ b/test/built-ins/Object/create/15.2.3.5-1-2.js @@ -4,15 +4,6 @@ /*--- es5id: 15.2.3.5-1-2 description: Object.create TypeError is not thrown if 'O' is null -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.create(null); - return true; - } catch (e) { - return false; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Object/create/15.2.3.5-4-305.js b/test/built-ins/Object/create/15.2.3.5-4-305.js index 0e3fe05858..225047a59d 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-305.js +++ b/test/built-ins/Object/create/15.2.3.5-4-305.js @@ -6,20 +6,12 @@ es5id: 15.2.3.5-4-305 description: > Object.create defines a data property when one property in 'Properties' is generic descriptor (8.12.9 step 4.a) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { var newObj = Object.create({}, { prop: { enumerable: true } }); - return newObj.hasOwnProperty("prop"); - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-306.js b/test/built-ins/Object/create/15.2.3.5-4-306.js index 4965a6edf6..328c209d49 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-306.js +++ b/test/built-ins/Object/create/15.2.3.5-4-306.js @@ -6,12 +6,8 @@ es5id: 15.2.3.5-4-306 description: > Object.create - [[Value]] is set as undefined if it is absent in data descriptor of one property in 'Properties' (8.12.9 step 4.a.i) -includes: [runTestCase.js] ---*/ -function testcase() { - - try { var newObj = Object.create({}, { prop: { writable: true, @@ -19,9 +15,6 @@ function testcase() { enumerable: true } }); - return newObj.hasOwnProperty("prop") && newObj.prop === undefined; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert(newObj.hasOwnProperty("prop"), 'newObj.hasOwnProperty("prop") !== true'); +assert.sameValue(newObj.prop, undefined, 'newObj.prop'); diff --git a/test/built-ins/Object/create/15.2.3.5-4-39.js b/test/built-ins/Object/create/15.2.3.5-4-39.js index 251b496d6f..6bd0d2a9a0 100644 --- a/test/built-ins/Object/create/15.2.3.5-4-39.js +++ b/test/built-ins/Object/create/15.2.3.5-4-39.js @@ -7,11 +7,8 @@ description: > Object.create - ensure that side-effects of gets occur in the same order as they would for: for (P in props) props[P] (15.2.3.7 step 5.a) -includes: [runTestCase.js] ---*/ -function testcase() { - var props = {}; props.prop1 = { value: 12, enumerable: true }; props.prop2 = { value: true, enumerable: true }; @@ -26,10 +23,5 @@ function testcase() { var newObj = Object.create({}, props); var index = 0; for (var q in newObj) { - if (tempArray[index++] !== q && newObj.hasOwnProperty(q)) { - return false; - } + assert.sameValue(tempArray[index++] !== q && newObj.hasOwnProperty(q), false, 'tempArray[index++] !== q && newObj.hasOwnProperty(q)'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-252.js b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-252.js index ba43a0327d..5003f3e485 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-5-b-252.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-5-b-252.js @@ -6,11 +6,8 @@ es5id: 15.2.3.7-5-b-252 description: > Object.defineProperties - value of 'set' property of 'descObj' is undefined (8.10.5 step 8.b) -includes: [runTestCase.js] ---*/ -function testcase() { - var getFun = function () { return 11; }; @@ -23,11 +20,7 @@ function testcase() { } }); - try { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - return obj.hasOwnProperty("prop") && typeof (desc.set) === "undefined"; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true'); +assert.sameValue(typeof (desc.set), "undefined", 'typeof (desc.set)'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-155.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-155.js index 66e8c16958..b765653ef1 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-155.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-155.js @@ -9,23 +9,17 @@ description: > greater than value of the length property is defined into 'O' without deleting any property with large index named (15.4.5.1 step 3.f) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; - try { Object.defineProperties(arr, { length: { value: 5 } }); - return arr.length === 5 && arr[0] === 0 && !arr.hasOwnProperty("1") && arr[2] === 2; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert.sameValue(arr.length, 5, 'arr.length'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")'); +assert.sameValue(arr[2], 2, 'arr[2]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-156.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-156.js index b461067e38..f2bd0349c1 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-156.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-156.js @@ -8,22 +8,17 @@ description: > property of 'O', test the [[Value]] field of 'desc' which equals to value of the length property is defined into 'O' without deleting any property with large index named (15.4.5.1 step 3.f) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; - try { + Object.defineProperties(arr, { length: { value: 3 } }); - return arr.length === 3 && arr[0] === 0 && !arr.hasOwnProperty("1") && arr[2] === 2; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert.sameValue(arr.length, 3, 'arr.length'); +assert.sameValue(arr[0], 0, 'arr[0]'); +assert.sameValue(arr.hasOwnProperty("1"), false, 'arr.hasOwnProperty("1")'); +assert.sameValue(arr[2], 2, 'arr[2]'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-159.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-159.js index b95d3457ad..51e462ce42 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-159.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-159.js @@ -8,26 +8,18 @@ description: > property of 'O', the [[Value]] field of 'desc' equals to value of the length property, test TypeError wouldn't be thrown when the length property is not writable (15.4.5.1 step 3.f.i) -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; Object.defineProperty(arr, "length", { writable: false }); - try { Object.defineProperties(arr, { length: { value: 0 } }); - return true && arr.length === 0; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert.sameValue(arr.length, 0, 'arr.length'); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-203.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-203.js index c3b5ac575b..39d5ee0a63 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-203.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-203.js @@ -9,10 +9,8 @@ description: > [[Enumerable]] of 'P' property in 'Attributes' is set as false value if [[Enumerable]] is absent in accessor descriptor 'desc' (15.4.5.1 step 4.c) -includes: [runTestCase.js] ---*/ -function testcase() { var arr = []; Object.defineProperties(arr, { @@ -24,10 +22,5 @@ function testcase() { }); for (var i in arr) { - if (i === "0" && arr.hasOwnProperty("0")) { - return false; - } + assert.sameValue(i === "0" && arr.hasOwnProperty("0"), false, 'i === "0" && arr.hasOwnProperty("0")'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-29.js b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-29.js index 0b3ab37f6a..3080c1615e 100644 --- a/test/built-ins/Object/defineProperties/15.2.3.7-6-a-29.js +++ b/test/built-ins/Object/defineProperties/15.2.3.7-6-a-29.js @@ -7,10 +7,8 @@ description: > Object.defineProperties - 'P' doesn't exist in 'O', test [[Enumerable]] of 'P' is set as false value if absent in data descriptor 'desc' (8.12.9 step 4.a.i) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperties(obj, { @@ -19,11 +17,6 @@ function testcase() { for (var prop in obj) { if (obj.hasOwnProperty(prop)) { - if (prop === "prop") { - return false; - } + assert.notSameValue(prop, "prop", 'prop'); } } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js index 90730a1bbf..65a3d68c67 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-116.js @@ -6,24 +6,22 @@ es5id: 15.2.3.6-4-116 description: > Object.defineProperty - 'O' is an Array, test the length property of 'O' is own data property (15.4.5.1 step 1) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = [0, 1]; Object.defineProperty(arrObj, "1", { value: 1, configurable: false }); - try { - Object.defineProperty(arrObj, "length", { value: 1 }); - return false; - } catch (e) { - var desc = Object.getOwnPropertyDescriptor(arrObj, "length"); - return Object.hasOwnProperty.call(arrObj, "length") && desc.value === 2 && - desc.writable === true && desc.configurable === false && desc.enumerable === false; - } - } -runTestCase(testcase); +assert.throws(TypeError, function() { + Object.defineProperty(arrObj, "length", { value: 1 }); +}); + +var desc = Object.getOwnPropertyDescriptor(arrObj, "length"); + +assert(Object.hasOwnProperty.call(arrObj, "length"), 'Object.hasOwnProperty.call(arrObj, "length")'); +assert.sameValue(desc.value, 2, 'desc.value'); +assert.sameValue(desc.writable, true, 'desc.writable'); +assert.sameValue(desc.configurable, false, 'desc.configurable'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-163.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-163.js index 20c373a466..99ad98928c 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-163.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-163.js @@ -8,24 +8,14 @@ description: > property of 'O', the [[Value]] field of 'desc' equals to value of the length property, test no TypeError is thrown when the length property is not writable (15.4.5.1 step 3.f.i) -includes: [runTestCase.js] ---*/ -function testcase() { - var arrObj = []; Object.defineProperty(arrObj, "length", { writable: false }); - try { Object.defineProperty(arrObj, "length", { value: 0 }); - return true; - } catch (e) { - return false; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-187.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-187.js index f1580d62b8..e6050fceb0 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-187.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-187.js @@ -9,24 +9,15 @@ description: > attribute of the length property in 'O' is false and value of 'name' is less than value of the length property (15.4.5.1 step 4.b) -includes: [runTestCase.js] ---*/ -function testcase() { var arrObj = [1, 2, 3]; Object.defineProperty(arrObj, "length", { writable: false }); - try { Object.defineProperty(arrObj, 1, { value: "abc" }); - return true; - } catch (e) { - return false; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-2.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-2.js index 392cff8df4..d78cae8269 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-2.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-2.js @@ -10,22 +10,16 @@ es5id: 15.2.3.6-4-2 description: > Object.defineProperty sets missing attributes to their default values (data properties)(8.12.9 step 4.a.i) -includes: [runTestCase.js] ---*/ -function testcase() { var o = {}; var desc = { value: 1 }; Object.defineProperty(o, "foo", desc); - + var propDesc = Object.getOwnPropertyDescriptor(o, "foo"); - - if (propDesc.value === 1 && // this is the value that was set - propDesc.writable === false && // false by default - propDesc.enumerable === false && // false by default - propDesc.configurable === false) { // false by default - return true; - } - } -runTestCase(testcase); + +assert.sameValue(propDesc.value, 1, 'propDesc.value'); // this is the value that was set +assert.sameValue(propDesc.writable, false, 'propDesc.writable'); // false by default +assert.sameValue(propDesc.enumerable, false, 'propDesc.enumerable'); // false by default +assert.sameValue(propDesc.configurable, false, 'propDesc.configurable'); // false by default diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-3.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-3.js index ffbfc155b7..a3873b1e04 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-3.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-3.js @@ -10,10 +10,8 @@ es5id: 15.2.3.6-4-3 description: > Object.defineProperty sets missing attributes to their default values (accessor)(8.12.9 step 4.b.i) -includes: [runTestCase.js] ---*/ -function testcase() { var o = {}; var getter = function () { return 1; }; @@ -23,11 +21,8 @@ function testcase() { var propDesc = Object.getOwnPropertyDescriptor(o, "foo"); - if (typeof(propDesc.get) === "function" && // the getter must be the function that was provided - propDesc.get === getter && - propDesc.enumerable === false && // false by default - propDesc.configurable === false) { // false by default - return true; - } - } -runTestCase(testcase); +assert.sameValue(typeof(propDesc.get), "function", 'typeof(propDesc.get)'); +assert.sameValue(propDesc.get, getter, 'propDesc.get'); // the getter must be the function that was provided +assert.sameValue(propDesc.set, undefined, 'propDesc.set'); // undefined by default +assert.sameValue(propDesc.enumerable, false, 'propDesc.enumerable'); // false by default +assert.sameValue(propDesc.configurable, false, 'propDesc.configurable'); // false by default \ No newline at end of file diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-327.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-327.js index 787aecbc3e..97d2ddcc78 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-327.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-327.js @@ -6,10 +6,10 @@ es5id: 15.2.3.6-4-327 description: > ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is true, [[Configurable]] is true) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; Object.defineProperty(obj, "prop", { @@ -22,9 +22,11 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var property in obj) { if (property === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); + +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-334.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-334.js index 851160e7aa..f4322915ec 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-334.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-334.js @@ -6,10 +6,10 @@ es5id: 15.2.3.6-4-334 description: > ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is true, [[Configurable]] is false) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; Object.defineProperty(obj, "prop", { @@ -22,9 +22,11 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); + +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-341.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-341.js index 87bfe85388..1a2324b5f1 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-341.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-341.js @@ -6,10 +6,8 @@ es5id: 15.2.3.6-4-341 description: > ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperty(obj, "prop", { @@ -21,10 +19,8 @@ function testcase() { var propertyDefineCorrect = obj.hasOwnProperty("prop"); var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); + +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-348.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-348.js index 701a132fb4..90804ded55 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-348.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-348.js @@ -6,10 +6,8 @@ es5id: 15.2.3.6-4-348 description: > ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperty(obj, "prop", { @@ -21,10 +19,8 @@ function testcase() { var propertyDefineCorrect = obj.hasOwnProperty("prop"); var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); + +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-355.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-355.js index b5d9f515f7..7b08f6ee69 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-355.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-355.js @@ -6,10 +6,10 @@ es5id: 15.2.3.6-4-355 description: > ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is true, [[Configurable]] is true) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; Object.defineProperty(obj, "prop", { @@ -22,9 +22,11 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var property in obj) { if (property === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); + +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-362.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-362.js index b829fc5a0d..1e5d40c2e2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-362.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-362.js @@ -6,10 +6,10 @@ es5id: 15.2.3.6-4-362 description: > ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is true, [[Configurable]] is false) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; Object.defineProperty(obj, "prop", { value: 2010, @@ -21,9 +21,11 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var property in obj) { if (property === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); + +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-369.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-369.js index 3104d404d8..1950c4a80a 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-369.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-369.js @@ -6,10 +6,8 @@ es5id: 15.2.3.6-4-369 description: > ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperty(obj, "prop", { @@ -21,10 +19,8 @@ function testcase() { var propertyDefineCorrect = obj.hasOwnProperty("prop"); var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); + +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-376.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-376.js index bffdefece3..310fee16eb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-376.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-376.js @@ -6,10 +6,8 @@ es5id: 15.2.3.6-4-376 description: > ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperty(obj, "prop", { @@ -21,10 +19,8 @@ function testcase() { var propertyDefineCorrect = obj.hasOwnProperty("prop"); var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); + +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-4.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-4.js index efe4a2288f..5e08bb35a4 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-4.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-4.js @@ -10,21 +10,16 @@ es5id: 15.2.3.6-4-4 description: > Object.defineProperty defines a data property if given a generic desc(8.12.9 step 4.a.i) -includes: [runTestCase.js] ---*/ -function testcase() { var o = {}; var desc = {}; Object.defineProperty(o, "foo", desc); var propDesc = Object.getOwnPropertyDescriptor(o, "foo"); - if (propDesc.value === undefined && // this is the value that was set - propDesc.writable === false && // false by default - propDesc.enumerable === false && // false by default - propDesc.configurable === false) { // false by default - return true; - } - } -runTestCase(testcase); + +assert.sameValue(propDesc.value, undefined, 'propDesc.value'); // undefined by default +assert.sameValue(propDesc.writable, false, 'propDesc.writable'); // false by default +assert.sameValue(propDesc.enumerable, false, 'propDesc.enumerable'); // false by default +assert.sameValue(propDesc.configurable, false, 'propDesc.configurable'); // false by default diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-424.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-424.js index 4d09765c28..1cfca488eb 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-424.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-424.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is true, [[Configurable]] is true) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; Object.defineProperty(obj, "prop", { @@ -25,10 +25,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-433.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-433.js index 225bf4f4bb..e374de5ab6 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-433.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-433.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is true, [[Configurable]] is false) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; Object.defineProperty(obj, "prop", { @@ -25,10 +25,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-442.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-442.js index 8ba4f14f5d..72f9bf32ff 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-442.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-442.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperty(obj, "prop", { @@ -24,11 +22,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-451.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-451.js index 538b67f167..ef9fb05c29 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-451.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-451.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperty(obj, "prop", { @@ -24,11 +22,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-460.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-460.js index 17bb0bf7f5..0ff4a8016e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-460.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-460.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is true, [[Configurable]] is true) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; var verifySetFunc = "data"; @@ -30,10 +30,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-469.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-469.js index 1b7d816c25..391bbf7aed 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-469.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-469.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is true, [[Configurable]] is false) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; var verifySetFunc = "data"; @@ -30,10 +30,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-478.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-478.js index 62d633da0b..519d80e7bf 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-478.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-478.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var verifySetFunc = "data"; @@ -29,11 +27,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-487.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-487.js index a9595e0945..8aaf8e2ba2 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-487.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-487.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var verifySetFunc = "data"; @@ -29,11 +27,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-496.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-496.js index 9610f8355c..2e63e773ba 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-496.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-496.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is true, [[Configurable]] is true) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; var getFunc = function () { @@ -29,10 +29,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-505.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-505.js index aa37ba9ceb..f15171ddcd 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-505.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-505.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is true, [[Configurable]] is false) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; var getFunc = function () { @@ -29,10 +29,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-514.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-514.js index b611b187e5..6b80aa1374 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-514.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-514.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var getFunc = function () { @@ -28,11 +26,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-523.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-523.js index 7355599c5a..8c1377dc0e 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-523.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-523.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var getFunc = function () { @@ -28,11 +26,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-532.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-532.js index 2dcacdd230..ee3370eaf5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-532.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-532.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is true, [[Configurable]] is true) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; var getFunc = function () { @@ -34,10 +34,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-541.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-541.js index d340a4fdf8..4651f86e43 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-541.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-541.js @@ -7,10 +7,10 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is true, [[Configurable]] is false) is enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = {}; var getFunc = function () { @@ -34,10 +34,11 @@ function testcase() { for (var p in obj) { if (p === "prop") { - return propertyDefineCorrect && desc.enumerable === true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, true, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-550.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-550.js index 85840516a2..bb17ddc1b5 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-550.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-550.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var getFunc = function () { @@ -33,11 +31,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/defineProperty/15.2.3.6-4-559.js b/test/built-ins/Object/defineProperty/15.2.3.6-4-559.js index 40bbe96d52..f2f308b34d 100644 --- a/test/built-ins/Object/defineProperty/15.2.3.6-4-559.js +++ b/test/built-ins/Object/defineProperty/15.2.3.6-4-559.js @@ -7,10 +7,8 @@ description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var getFunc = function () { @@ -33,11 +31,8 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { - if (p === "prop") { - return false; - } + assert.notSameValue(p, "prop", 'p'); } - return propertyDefineCorrect && desc.enumerable === false; - } -runTestCase(testcase); +assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-224.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-224.js index d1673e085a..1c84fe8264 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-224.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-224.js @@ -6,19 +6,12 @@ es5id: 15.2.3.3-4-224 description: > Object.getOwnPropertyDescriptor - ensure that 'value' property of returned object is data property with correct 'writable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); - try { desc.value = "overwriteDataProperty"; - return desc.value === "overwriteDataProperty"; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert.sameValue(desc.value, "overwriteDataProperty", 'desc.value'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-226.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-226.js index 7e0bfdb820..326e8d4192 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-226.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-226.js @@ -7,23 +7,16 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'value' property of returned object is data property with correct 'configurable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); var propDefined = "value" in desc; - try { delete desc.value; var propDeleted = "value" in desc; - return propDefined && !propDeleted; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert(propDefined, 'propDefined !== true'); +assert.sameValue(propDeleted, false, 'propDeleted'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-228.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-228.js index 45c701c806..7bd355aae3 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-228.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-228.js @@ -7,19 +7,12 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'writable' property of returned object is data property with correct 'writable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); - try { desc.writable = "overwriteDataProperty"; - return desc.writable === "overwriteDataProperty"; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert.sameValue(desc.writable, "overwriteDataProperty", 'desc.writable'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-230.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-230.js index 76fabb3680..0e8d7c9208 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-230.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-230.js @@ -7,23 +7,16 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'writable' property of returned object is data property with correct 'configurable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); var propDefined = ("writable" in desc); - try { delete desc.writable; var propDeleted = "writable" in desc; - return propDefined && !propDeleted; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert(propDefined, 'propDefined !== true'); +assert.sameValue(propDeleted, false, 'propDeleted'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-232.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-232.js index 11ba00c9da..43203e281d 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-232.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-232.js @@ -7,19 +7,12 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'enumerable' property of returned object is data property with correct 'writable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); - try { desc.enumerable = "overwriteDataProperty"; - return desc.enumerable === "overwriteDataProperty"; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert.sameValue(desc.enumerable, "overwriteDataProperty", 'desc.enumerable'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-234.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-234.js index 1152a9b842..d4c6ea9d83 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-234.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-234.js @@ -7,23 +7,16 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'enumerable' property of returned object is data property with correct 'configurable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); var propDefined = "enumerable" in desc; - try { delete desc.enumerable; var propDeleted = "enumerable" in desc; - return propDefined && !propDeleted; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert(propDefined, 'propDefined !== true'); +assert.sameValue(propDeleted, false, 'propDeleted'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-236.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-236.js index e427e8dc2b..960fc5cf34 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-236.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-236.js @@ -7,19 +7,12 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'configurable' property of returned object is data property with correct 'writable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); - try { desc.writable = "overwriteDataProperty"; - return desc.writable === "overwriteDataProperty"; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert.sameValue(desc.writable, "overwriteDataProperty", 'desc.writable'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-238.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-238.js index d60065d40b..5e877a51dc 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-238.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-238.js @@ -7,23 +7,16 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'configurable' property of returned object is data property with correct 'configurable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "property": "ownDataProperty" }; var desc = Object.getOwnPropertyDescriptor(obj, "property"); var propDefined = "configurable" in desc; - - try { + delete desc.configurable; var propDeleted = "configurable" in desc; - return propDefined && !propDeleted; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert(propDefined, 'propDefined !== true'); +assert.sameValue(propDeleted, false, 'propDeleted'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-240.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-240.js index 41124f7b23..35f469594b 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-240.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-240.js @@ -6,10 +6,8 @@ es5id: 15.2.3.3-4-240 description: > Object.getOwnPropertyDescriptor - ensure that 'get' property of returned object is data property with correct 'writable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var fun = function () { return "ownGetProperty"; @@ -21,11 +19,6 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "property"); - try { desc.get = "overwriteGetProperty"; - return desc.get === "overwriteGetProperty"; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert.sameValue(desc.get, "overwriteGetProperty", 'desc.get'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-242.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-242.js index 3ec1506288..d7800ba620 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-242.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-242.js @@ -7,10 +7,8 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'get' property of returned object is data property with correct 'configurable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var fun = function () { return "ownDataProperty"; @@ -24,13 +22,8 @@ function testcase() { var propDefined = "get" in desc; - try { delete desc.get; var propDeleted = "get" in desc; - return propDefined && !propDeleted; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert(propDefined, 'propDefined !== true'); +assert.sameValue(propDeleted, false, 'propDeleted'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-244.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-244.js index 38ff3c445b..1435215972 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-244.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-244.js @@ -6,10 +6,8 @@ es5id: 15.2.3.3-4-244 description: > Object.getOwnPropertyDescriptor - ensure that 'set' property of returned object is data property with correct 'writable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var fun = function () { return "ownSetProperty"; @@ -21,11 +19,6 @@ function testcase() { var desc = Object.getOwnPropertyDescriptor(obj, "property"); - try { desc.set = "overwriteSetProperty"; - return desc.set === "overwriteSetProperty"; - } catch (e) { - return false; - } - } -runTestCase(testcase); + +assert.sameValue(desc.set, "overwriteSetProperty", 'desc.set'); diff --git a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-246.js b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-246.js index fb0f91a865..210ace76fb 100644 --- a/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-246.js +++ b/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-4-246.js @@ -7,10 +7,8 @@ description: > Object.getOwnPropertyDescriptor - ensure that 'set' property of returned object is data property with correct 'configurable' attribute -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; var fun = function () { return "ownSetProperty"; @@ -24,13 +22,8 @@ function testcase() { var propDefined = "set" in desc; - try { delete desc.set; var propDeleted = "set" in desc; - return propDefined && !propDeleted; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert(propDefined, 'propDefined !== true'); +assert.sameValue(propDeleted, false, 'propDeleted'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-1.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-1.js index 5d0dca14cb..6af3d418ee 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-1.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-1.js @@ -4,12 +4,9 @@ /*--- es5id: 15.2.3.4-4-1 description: Object.getOwnPropertyNames returns array of property names (Global) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var result = Object.getOwnPropertyNames(fnGlobalObject()); var expResult = ["NaN", "Infinity", "undefined", "eval", "parseInt", "parseFloat", "isNaN", "isFinite", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "Object", "Function", "Array", "String", "Boolean", "Number", "Date", "Date", "RegExp", "Error", "EvalError", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "Math", "JSON"]; @@ -19,11 +16,5 @@ function testcase() { } for (var p1 in expResult) { - if (!result1[expResult[p1]]) { - return false; - } + assert(result1[expResult[p1]], 'result1[expResult[p1]] !== true'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-36.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-36.js index 80a7b1a103..8348c8209c 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-36.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-36.js @@ -6,11 +6,8 @@ es5id: 15.2.3.4-4-36 description: > Object.getOwnPropertyNames - inherited data properties are not pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { - var proto = { "parent": "parent" }; var Con = function () { }; @@ -21,10 +18,5 @@ function testcase() { var result = Object.getOwnPropertyNames(child); for (var p in result) { - if (result[p] === "parent") { - return false; - } + assert.notSameValue(result[p], "parent", 'result[p]'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-37.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-37.js index 14090af8d4..7ee68cada5 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-37.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-37.js @@ -6,10 +6,8 @@ es5id: 15.2.3.4-4-37 description: > Object.getOwnPropertyNames - inherited accessor properties are not pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "parent", { get: function () { @@ -26,10 +24,5 @@ function testcase() { var result = Object.getOwnPropertyNames(child); for (var p in result) { - if (result[p] === "parent") { - return false; - } + assert.notSameValue(result[p], "parent", 'result[p]'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-40.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-40.js index 07650d4da8..1597725f12 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-40.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-40.js @@ -6,11 +6,8 @@ es5id: 15.2.3.4-4-40 description: > Object.getOwnPropertyNames - inherited data property of String object 'O' is not pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { - try { var str = new String("abc"); String.prototype.protoProperty = "protoString"; @@ -18,14 +15,5 @@ function testcase() { var result = Object.getOwnPropertyNames(str); for (var p in result) { - if (result[p] === "protoProperty") { - return false; - } + assert.notSameValue(result[p], "protoProperty", 'result[p]'); } - - return true; - } finally { - delete String.prototype.protoProperty; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-41.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-41.js index e4990e311c..376e30846a 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-41.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-41.js @@ -6,11 +6,8 @@ es5id: 15.2.3.4-4-41 description: > Object.getOwnPropertyNames - inherited accessor property of String object 'O' is not pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { - try { var str = new String("abc"); Object.defineProperty(String.prototype, "protoProperty", { @@ -23,13 +20,5 @@ function testcase() { var result = Object.getOwnPropertyNames(str); for (var p in result) { - if (result[p] === "protoProperty") { - return false; - } + assert.notSameValue(result[p], "protoProperty", 'result[p]'); } - return true; - } finally { - delete String.prototype.protoProperty; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-42.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-42.js index 2e975c3bbe..4f81f8454d 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-42.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-42.js @@ -6,10 +6,10 @@ es5id: 15.2.3.4-4-42 description: > Object.getOwnPropertyNames - own data property of String object 'O' is pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var str = new String("abc"); Object.defineProperty(str, "ownProperty", { @@ -21,10 +21,9 @@ function testcase() { for (var p in result) { if (result[p] === "ownProperty") { - return true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-43.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-43.js index 4e0b29f679..b3ae879d9e 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-43.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-43.js @@ -6,10 +6,10 @@ es5id: 15.2.3.4-4-43 description: > Object.getOwnPropertyNames - own accessor property of String object 'O' is pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var str = new String("abc"); Object.defineProperty(str, "ownProperty", { @@ -23,10 +23,9 @@ function testcase() { for (var p in result) { if (result[p] === "ownProperty") { - return true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-45.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-45.js index aba29dca27..5772ef4d0a 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-45.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-45.js @@ -6,11 +6,8 @@ es5id: 15.2.3.4-4-45 description: > Object.getOwnPropertyNames - inherited data property of Array object 'O' is not pushed into the returned array. -includes: [runTestCase.js] ---*/ -function testcase() { - try { var arr = [0, 1, 2]; Array.prototype.protoProperty = "protoArray"; @@ -18,13 +15,5 @@ function testcase() { var result = Object.getOwnPropertyNames(arr); for (var p in result) { - if (result[p] === "protoProperty") { - return false; - } + assert.notSameValue(result[p], "protoProperty", 'result[p]'); } - return true; - } finally { - delete Array.prototype.protoProperty; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-46.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-46.js index b103c34b78..85773d0cdf 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-46.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-46.js @@ -6,11 +6,8 @@ es5id: 15.2.3.4-4-46 description: > Object.getOwnPropertyNames - inherited accessor property of Array object 'O' is not pushed into the returned array. -includes: [runTestCase.js] ---*/ -function testcase() { - try { var arr = [0, 1, 2]; Object.defineProperty(Array.prototype, "protoProperty", { @@ -23,13 +20,5 @@ function testcase() { var result = Object.getOwnPropertyNames(arr); for (var p in result) { - if (result[p] === "protoProperty") { - return false; - } + assert.notSameValue(result[p], "protoProperty", 'result[p]'); } - return true; - } finally { - delete Array.prototype.protoProperty; - } - } -runTestCase(testcase); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-47.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-47.js index 4bbba028c1..ac4193f202 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-47.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-47.js @@ -6,10 +6,10 @@ es5id: 15.2.3.4-4-47 description: > Object.getOwnPropertyNames - own data property of Array object 'O' is pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var arr = [0, 1, 2]; arr.ownProperty = "ownArray"; @@ -17,10 +17,9 @@ function testcase() { for (var p in result) { if (result[p] === "ownProperty") { - return true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-48.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-48.js index f09d5b145a..61299ad640 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-48.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-48.js @@ -6,10 +6,10 @@ es5id: 15.2.3.4-4-48 description: > Object.getOwnPropertyNames - own accessor property of Array object 'O' is pushed into the returned array. -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var arr = [0, 1, 2]; Object.defineProperty(arr, "ownProperty", { @@ -23,10 +23,9 @@ function testcase() { for (var p in result) { if (result[p] === "ownProperty") { - return true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-3.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-3.js index f1c3fb7d3c..27e4eaaf9c 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-3.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-3.js @@ -6,20 +6,19 @@ es5id: 15.2.3.4-4-b-3 description: > Object.getOwnPropertyNames - own property named empty('') is pushed into the returned array -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = { "": "empty" }; var result = Object.getOwnPropertyNames(obj); for (var p in result) { if (result[p] === "") { - return true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-4.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-4.js index 9b826fbda5..fdcec33553 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-4.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-4.js @@ -6,22 +6,15 @@ es5id: 15.2.3.4-4-b-4 description: > Object.getOwnPropertyNames - elements of the returned array are writable -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "a": "a" }; var result = Object.getOwnPropertyNames(obj); - try { var beforeOverride = (result[0] === "a"); result[0] = "b"; var afterOverride = (result[0] === "b"); - return beforeOverride && afterOverride; - } catch (ex) { - return false; - } - } -runTestCase(testcase); +assert(beforeOverride, 'beforeOverride !== true'); +assert(afterOverride, 'afterOverride !== true'); diff --git a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-5.js b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-5.js index 22962ec748..d6c3a2528d 100644 --- a/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-5.js +++ b/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-b-5.js @@ -6,20 +6,19 @@ es5id: 15.2.3.4-4-b-5 description: > Object.getOwnPropertyNames - elements of the returned array are enumerable -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = { "a": "a" }; var result = Object.getOwnPropertyNames(obj); for (var p in result) { if (result[p] === "a") { - return true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/keys/15.2.3.14-3-5.js b/test/built-ins/Object/keys/15.2.3.14-3-5.js index 035dd63c24..ed4c7b7cb3 100644 --- a/test/built-ins/Object/keys/15.2.3.14-3-5.js +++ b/test/built-ins/Object/keys/15.2.3.14-3-5.js @@ -4,15 +4,13 @@ /*--- es5id: 15.2.3.14-3-5 description: Object.keys must return a fresh array on each invocation -includes: [runTestCase.js] ---*/ -function testcase() { var literal = {a: 1}; var keysBefore = Object.keys(literal); - if (keysBefore[0] != 'a') return false; + assert.sameValue(keysBefore[0], 'a', 'keysBefore[0]'); keysBefore[0] = 'x'; var keysAfter = Object.keys(literal); - return (keysBefore[0] == 'x') && (keysAfter[0] == 'a'); - } -runTestCase(testcase); + +assert.sameValue(keysBefore[0], 'x', 'keysBefore[0]'); +assert.sameValue(keysAfter[0], 'a', 'keysAfter[0]'); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-10.js b/test/built-ins/Object/keys/15.2.3.14-5-10.js index 1464abd165..7c78da96c7 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-10.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-10.js @@ -7,10 +7,8 @@ description: > Object.keys - inherted enumerable accessor property that is over-ridden by non-enumerable own accessor property is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "prop", { get: function () { }, @@ -30,11 +28,5 @@ function testcase() { var arr = Object.keys(obj); for (var p in arr) { - if (arr[p] === "prop") { - return false; - } + assert.notSameValue(arr[p], "prop", 'arr[p]'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-11.js b/test/built-ins/Object/keys/15.2.3.14-5-11.js index 2b34b9927b..3a6c31e0c4 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-11.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-11.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-11 description: > Object.keys - own enumerable indexed data property of dense array 'O' is defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var obj = [1, 2, 3, 4, 5]; var arr = Object.keys(obj); @@ -17,13 +15,7 @@ function testcase() { var initValue = 0; for (var p in arr) { if (arr.hasOwnProperty(p)) { - if (arr[p] !== initValue.toString()) { - return false; - } + assert.sameValue(arr[p], initValue.toString(), 'arr[p]'); initValue++; } } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-12.js b/test/built-ins/Object/keys/15.2.3.14-5-12.js index b4f7a73ea2..0e565cc0da 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-12.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-12.js @@ -6,10 +6,10 @@ es5id: 15.2.3.14-5-12 description: > Object.keys - own enumerable indexed accessor property of dense array 'O' is defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = [2, 3, 4, 5]; Object.defineProperty(obj, "prop", { @@ -25,11 +25,10 @@ function testcase() { for (var p in arr) { if (arr.hasOwnProperty(p)) { if (arr[p] === "prop") { - return true; + propertyFound = true; + break; } } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-13.js b/test/built-ins/Object/keys/15.2.3.14-5-13.js index 61115cfca2..1dd461cabd 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-13.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-13.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-13 description: > Object.keys - own enumerable indexed data property of sparse array 'O' is defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var obj = [1, , 3, , 5]; Object.defineProperty(obj, 5, { @@ -29,16 +27,9 @@ function testcase() { var index; var initValue = 0; for (index = 0; index < 3; index++) { - if (arr[index] !== initValue.toString()) { - return false; - } + assert.sameValue(arr[index], initValue.toString(), 'Unexpected property at index: ' + index); initValue += 2; } - if (arr.length !== 4 || arr[3] !== "10000") { - return false; - } - - return true; - } -runTestCase(testcase); +assert.sameValue(arr.length, 4, 'arr.length'); +assert.sameValue(arr[3], "10000", 'arr[3]'); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-14.js b/test/built-ins/Object/keys/15.2.3.14-5-14.js index 9d151e9651..6b9c3ae252 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-14.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-14.js @@ -6,10 +6,10 @@ es5id: 15.2.3.14-5-14 description: > Object.keys - own enumerable indexed accessor property of sparse array 'O' is defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { +var propertyFound = false; + var obj = [1, , 3, , 5]; Object.defineProperty(obj, "10000", { @@ -24,10 +24,9 @@ function testcase() { for (var p in arr) { if (arr[p] === "10000") { - return true; + propertyFound = true; + break; } } - return false; - } -runTestCase(testcase); +assert(propertyFound, 'Property not found'); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-15.js b/test/built-ins/Object/keys/15.2.3.14-5-15.js index 963e05313c..c7805c0304 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-15.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-15.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-15 description: > Object.keys - own enumerable indexed data property of String object 'O' is defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var obj = new String("xyz"); obj[-20] = -20; obj[20] = 20; @@ -23,11 +21,5 @@ function testcase() { var arr = Object.keys(obj); for (var i = 0; i < arr.length; i++) { - if (!obj.hasOwnProperty(arr[i])) { - return false; - } + assert(obj.hasOwnProperty(arr[i]), 'obj.hasOwnProperty(arr[i]) !== true'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-16.js b/test/built-ins/Object/keys/15.2.3.14-5-16.js index d165167030..1031fd08c7 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-16.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-16.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-16 description: > Object.keys - own enumerable indexed accessor property of String object 'O' is defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var obj = new String("xyz"); obj[-20] = -20; obj[20] = 20; @@ -28,11 +26,5 @@ function testcase() { var arr = Object.keys(obj); for (var i = 0; i < arr.length; i++) { - if (!obj.hasOwnProperty(arr[i])) { - return false; - } + assert(obj.hasOwnProperty(arr[i]), 'obj.hasOwnProperty(arr[i]) !== true'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-3.js b/test/built-ins/Object/keys/15.2.3.14-5-3.js index 034d6b1710..45d321cfe7 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-3.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-3.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-3 description: > Object.keys - non-enumerable own data property of 'O' is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop1: 1001, prop2: 1002 }; Object.defineProperty(obj, "prop3", { @@ -28,12 +26,6 @@ function testcase() { for (var p in arr) { if (arr.hasOwnProperty(p)) { - if (arr[p] === "prop4") { - return false; - } + assert.notSameValue(arr[p], "prop4", 'arr[p]'); } } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-4.js b/test/built-ins/Object/keys/15.2.3.14-5-4.js index 8a81da67b4..ed6346c085 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-4.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-4.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-4 description: > Object.keys - non-enumerable own accessor property of 'O' is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {}; Object.defineProperty(obj, "prop1", { @@ -32,12 +30,6 @@ function testcase() { for (var p in arr) { if (arr.hasOwnProperty(p)) { - if (arr[p] === "prop2") { - return false; - } + assert.notSameValue(arr[p], "prop2", 'arr[p]'); } } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-5.js b/test/built-ins/Object/keys/15.2.3.14-5-5.js index 253272d947..996f595a1f 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-5.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-5.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-5 description: > Object.keys - inherited enumerable data property of 'O' is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "inheritedProp", { value: 1003, @@ -25,11 +23,5 @@ function testcase() { var arr = Object.keys(obj); for (var p in arr) { - if (arr[p] === "inheritedProp") { - return false; - } + assert.notSameValue(arr[p], "inheritedProp", 'arr[p]'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-6.js b/test/built-ins/Object/keys/15.2.3.14-5-6.js index aeee771d6b..1040551379 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-6.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-6.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-5-6 description: > Object.keys - inherited enumerable accessor property of 'O' is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "inheritedProp", { get: function () { @@ -33,11 +31,5 @@ function testcase() { var arr = Object.keys(obj); for (var p in arr) { - if (arr[p] === "inheritedProp") { - return false; - } + assert.notSameValue(arr[p], "inheritedProp", 'arr[p]'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-7.js b/test/built-ins/Object/keys/15.2.3.14-5-7.js index c855bf7d90..8fb146cd20 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-7.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-7.js @@ -7,10 +7,8 @@ description: > Object.keys - inherted enumerable data property that is over-ridden by non-enumerable own data property is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "prop", { value: 1003, @@ -30,11 +28,5 @@ function testcase() { var arr = Object.keys(obj); for (var p in arr) { - if (arr[p] === "prop") { - return false; - } + assert.notSameValue(arr[p], "prop", 'arr[p]'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-8.js b/test/built-ins/Object/keys/15.2.3.14-5-8.js index d664f67f81..37acf9b4f9 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-8.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-8.js @@ -7,10 +7,8 @@ description: > Object.keys - inherted enumerable data property that is over-ridden by non-enumerable own accessor property is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "prop", { value: 1003, @@ -30,11 +28,5 @@ function testcase() { var arr = Object.keys(obj); for (var p in arr) { - if (arr[p] === "prop") { - return false; - } + assert.notSameValue(arr[p], "prop", 'arr[p]'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-9.js b/test/built-ins/Object/keys/15.2.3.14-5-9.js index 00f5ae5145..f88c546c00 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-9.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-9.js @@ -7,10 +7,8 @@ description: > Object.keys - inherted enumerable accessor property that is over-ridden by non-enumerable own data property is not defined in returned array -includes: [runTestCase.js] ---*/ -function testcase() { var proto = {}; Object.defineProperty(proto, "prop", { get: function () { }, @@ -30,11 +28,5 @@ function testcase() { var arr = Object.keys(obj); for (var p in arr) { - if (arr[p] === "prop") { - return false; - } + assert.notSameValue(arr[p], "prop", 'arr[p]'); } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-a-2.js b/test/built-ins/Object/keys/15.2.3.14-5-a-2.js index 06dd86fac1..10f811ac6d 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-a-2.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-a-2.js @@ -6,22 +6,16 @@ es5id: 15.2.3.14-5-a-2 description: > Object.keys - 'writable' attribute of element of returned array is correct -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop1: 100 }; var array = Object.keys(obj); - try { array[0] = "isWritable"; var desc = Object.getOwnPropertyDescriptor(array, "0"); - return array[0] === "isWritable" && desc.hasOwnProperty("writable") && desc.writable === true; - } catch (e) { - return false; - } - } -runTestCase(testcase); +assert.sameValue(array[0], "isWritable", 'array[0]'); +assert(desc.hasOwnProperty("writable"), 'desc.hasOwnProperty("writable") !== true'); +assert.sameValue(desc.writable, true, 'desc.writable'); diff --git a/test/built-ins/Object/keys/15.2.3.14-5-b-1.js b/test/built-ins/Object/keys/15.2.3.14-5-b-1.js index 72af838c12..6c5766333c 100644 --- a/test/built-ins/Object/keys/15.2.3.14-5-b-1.js +++ b/test/built-ins/Object/keys/15.2.3.14-5-b-1.js @@ -4,10 +4,8 @@ /*--- es5id: 15.2.3.14-5-b-1 description: Object.keys - Verify that 'index' of returned array is ascend by 1 -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop1: 100, prop2: 200, prop3: 300 }; var array = Object.keys(obj); @@ -15,13 +13,7 @@ function testcase() { var idx = 0; for (var index in array) { if (array.hasOwnProperty(index)) { - if (index !== idx.toString()) { - return false; - } + assert.sameValue(index, idx.toString(), 'index'); idx++; } } - - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-6-1.js b/test/built-ins/Object/keys/15.2.3.14-6-1.js index bb9e7da6b9..884abd796d 100644 --- a/test/built-ins/Object/keys/15.2.3.14-6-1.js +++ b/test/built-ins/Object/keys/15.2.3.14-6-1.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-6-1 description: > Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (dense array) -includes: [runTestCase.js] ---*/ -function testcase() { var denseArray = [1, 2, 3]; var tempArray = []; @@ -22,11 +20,5 @@ function testcase() { var returnedArray = Object.keys(denseArray); for (var index in returnedArray) { - if (tempArray[index] !== returnedArray[index]) { - return false; - } + assert.sameValue(tempArray[index], returnedArray[index], 'tempArray[index]'); } - return true; - - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-6-2.js b/test/built-ins/Object/keys/15.2.3.14-6-2.js index 4d9d980c6c..c3a1537e07 100644 --- a/test/built-ins/Object/keys/15.2.3.14-6-2.js +++ b/test/built-ins/Object/keys/15.2.3.14-6-2.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-6-2 description: > Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (sparse array) -includes: [runTestCase.js] ---*/ -function testcase() { var sparseArray = [1, 2, , 4, , 6]; var tempArray = []; @@ -22,10 +20,5 @@ function testcase() { var returnedArray = Object.keys(sparseArray); for (var index in returnedArray) { - if (tempArray[index] !== returnedArray[index]) { - return false; - } + assert.sameValue(tempArray[index], returnedArray[index], 'tempArray[index]'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-6-3.js b/test/built-ins/Object/keys/15.2.3.14-6-3.js index 26ff8a89e0..108056b333 100644 --- a/test/built-ins/Object/keys/15.2.3.14-6-3.js +++ b/test/built-ins/Object/keys/15.2.3.14-6-3.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-6-3 description: > Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (String object) -includes: [runTestCase.js] ---*/ -function testcase() { var str = new String("abc"); var tempArray = []; @@ -22,10 +20,5 @@ function testcase() { var returnedArray = Object.keys(str); for (var index in returnedArray) { - if (tempArray[index] !== returnedArray[index]) { - return false; - } + assert.sameValue(tempArray[index], returnedArray[index], 'tempArray[index]'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-6-4.js b/test/built-ins/Object/keys/15.2.3.14-6-4.js index 02cd2f124e..b10ea76150 100644 --- a/test/built-ins/Object/keys/15.2.3.14-6-4.js +++ b/test/built-ins/Object/keys/15.2.3.14-6-4.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-6-4 description: > Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (Arguments object) -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (a, b, c) { return arguments; }; @@ -26,10 +24,5 @@ function testcase() { var returnedArray = Object.keys(args); for (var index in returnedArray) { - if (tempArray[index] !== returnedArray[index]) { - return false; - } + assert.sameValue(tempArray[index], returnedArray[index], 'tempArray[index]'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-6-5.js b/test/built-ins/Object/keys/15.2.3.14-6-5.js index 53a1516df3..9e5984a78a 100644 --- a/test/built-ins/Object/keys/15.2.3.14-6-5.js +++ b/test/built-ins/Object/keys/15.2.3.14-6-5.js @@ -6,10 +6,8 @@ es5id: 15.2.3.14-6-5 description: > Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (any other built-in object) -includes: [runTestCase.js] ---*/ -function testcase() { var obj = new Date(); obj.prop1 = 100; obj.prop2 = "prop2"; @@ -24,10 +22,5 @@ function testcase() { var returnedArray = Object.keys(obj); for (var index in returnedArray) { - if (tempArray[index] !== returnedArray[index]) { - return false; - } + assert.sameValue(tempArray[index], returnedArray[index], 'tempArray[index]'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Object/keys/15.2.3.14-6-6.js b/test/built-ins/Object/keys/15.2.3.14-6-6.js index ba61143583..5322bd3b56 100644 --- a/test/built-ins/Object/keys/15.2.3.14-6-6.js +++ b/test/built-ins/Object/keys/15.2.3.14-6-6.js @@ -6,12 +6,9 @@ es5id: 15.2.3.14-6-6 description: > Object.keys - the order of elements in returned array is the same with the order of properties in 'O' (global Object) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var obj = fnGlobalObject(); var tempArray = []; @@ -24,10 +21,5 @@ function testcase() { var returnedArray = Object.keys(obj); for (var index in returnedArray) { - if (tempArray[index] !== returnedArray[index]) { - return false; - } + assert.sameValue(tempArray[index], returnedArray[index], 'tempArray[index]'); } - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/undefined/15.1.1.3-1.js b/test/built-ins/undefined/15.1.1.3-1.js index 586e7b5c95..8f07eb4e24 100644 --- a/test/built-ins/undefined/15.1.1.3-1.js +++ b/test/built-ins/undefined/15.1.1.3-1.js @@ -5,17 +5,10 @@ es5id: 15.1.1.3-1 description: undefined is not writable, should not throw in non-strict mode flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase(){ - undefined = 5; - if(typeof undefined !== "undefined") return false; +undefined = 5; +assert.sameValue(typeof undefined, "undefined", 'typeof undefined'); - var nosuchproperty; - if(nosuchproperty !== undefined) return false; - - return true; -} - -runTestCase(testcase); +var nosuchproperty; +assert.sameValue(nosuchproperty, undefined, 'nosuchproperty');