From 8ea6a7e374f83b180fe728c45c2e38645a14a1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:25:42 +0200 Subject: [PATCH] Replace runTestCase with assert helpers [test/built-ins/JSON] --- test/built-ins/JSON/15.12-0-1.js | 9 ++------- test/built-ins/JSON/15.12-0-4.js | 9 ++------- test/built-ins/JSON/parse/15.12.1.1-0-9.js | 6 ------ test/built-ins/JSON/parse/15.12.2-0-1.js | 8 +------- test/built-ins/JSON/parse/15.12.2-0-2.js | 9 ++------- test/built-ins/JSON/parse/15.12.2-0-3.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-0-1.js | 8 +------- test/built-ins/JSON/stringify/15.12.3-0-2.js | 9 ++------- test/built-ins/JSON/stringify/15.12.3-0-3.js | 9 ++------- test/built-ins/JSON/stringify/15.12.3-11-16.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-17.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-18.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-19.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-20.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-21.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-22.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-23.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-24.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-25.js | 8 ++------ test/built-ins/JSON/stringify/15.12.3-11-26.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-6-a-1.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-6-a-2.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-6-b-4.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-7-a-1.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-8-a-1.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-8-a-2.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-8-a-3.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-8-a-4.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3-8-a-5.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js | 7 ++----- test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js | 7 ++----- 34 files changed, 64 insertions(+), 195 deletions(-) diff --git a/test/built-ins/JSON/15.12-0-1.js b/test/built-ins/JSON/15.12-0-1.js index fd328be0c8..0a236cc59d 100644 --- a/test/built-ins/JSON/15.12-0-1.js +++ b/test/built-ins/JSON/15.12-0-1.js @@ -8,13 +8,8 @@ info: > 4.2 calls out JSON as one of the built-in objects. es5id: 15.12-0-1 description: JSON must be a built-in object -includes: [runTestCase.js] ---*/ -function testcase() { var o = JSON; - if (typeof(o) === "object") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(o), "object", 'typeof(o)'); diff --git a/test/built-ins/JSON/15.12-0-4.js b/test/built-ins/JSON/15.12-0-4.js index d4abddac7c..d9f92a391c 100644 --- a/test/built-ins/JSON/15.12-0-4.js +++ b/test/built-ins/JSON/15.12-0-4.js @@ -10,18 +10,13 @@ info: > JSON, and we should not be able to enumerate them. es5id: 15.12-0-4 description: JSON object's properties must be non enumerable -includes: [runTestCase.js] ---*/ -function testcase() { var o = JSON; var i = 0; for (var p in o) { i++; } - if (i === 0) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(i, 0, 'i'); diff --git a/test/built-ins/JSON/parse/15.12.1.1-0-9.js b/test/built-ins/JSON/parse/15.12.1.1-0-9.js index bd538d6080..e669bb290e 100644 --- a/test/built-ins/JSON/parse/15.12.1.1-0-9.js +++ b/test/built-ins/JSON/parse/15.12.1.1-0-9.js @@ -4,16 +4,10 @@ /*--- es5id: 15.12.1.1-0-9 description: Whitespace characters can appear before/after any JSONtoken -includes: [runTestCase.js] ---*/ -function testcase() { - JSON.parse('\t\r \n{\t\r \n'+ '"property"\t\r \n:\t\r \n{\t\r \n}\t\r \n,\t\r \n' + '"prop2"\t\r \n:\t\r \n'+ '[\t\r \ntrue\t\r \n,\t\r \nnull\t\r \n,123.456\t\r \n]'+ '\t\r \n}\t\r \n'); // should JOSN parse without error - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/JSON/parse/15.12.2-0-1.js b/test/built-ins/JSON/parse/15.12.2-0-1.js index bc4e299261..f6170a03ba 100644 --- a/test/built-ins/JSON/parse/15.12.2-0-1.js +++ b/test/built-ins/JSON/parse/15.12.2-0-1.js @@ -15,14 +15,8 @@ info: > taking 2 parameters. es5id: 15.12.2-0-1 description: JSON.parse must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = JSON.parse; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/JSON/parse/15.12.2-0-2.js b/test/built-ins/JSON/parse/15.12.2-0-2.js index c9eb96bad3..5d2ec29b38 100644 --- a/test/built-ins/JSON/parse/15.12.2-0-2.js +++ b/test/built-ins/JSON/parse/15.12.2-0-2.js @@ -15,14 +15,9 @@ info: > taking 2 parameters. es5id: 15.12.2-0-2 description: JSON.parse must exist as a function taking 2 parameters -includes: [runTestCase.js] ---*/ -function testcase() { var f = JSON.parse; - if (typeof(f) === "function" && f.length === 2) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(typeof(f), "function", 'typeof(f)'); +assert.sameValue(f.length, 2, 'f.length'); diff --git a/test/built-ins/JSON/parse/15.12.2-0-3.js b/test/built-ins/JSON/parse/15.12.2-0-3.js index fca893970f..7ff0289a9a 100644 --- a/test/built-ins/JSON/parse/15.12.2-0-3.js +++ b/test/built-ins/JSON/parse/15.12.2-0-3.js @@ -8,12 +8,9 @@ info: > should be able to delete (8.6.2.5) the stringify and parse properties. es5id: 15.12.2-0-3 description: JSON.parse must be deletable (configurable) -includes: [runTestCase.js] ---*/ -function testcase() { var o = JSON; var desc = Object.getOwnPropertyDescriptor(o, "parse"); - return desc.configurable === true; - } -runTestCase(testcase); + +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/JSON/stringify/15.12.3-0-1.js b/test/built-ins/JSON/stringify/15.12.3-0-1.js index a8b4a6e75b..c3603de047 100644 --- a/test/built-ins/JSON/stringify/15.12.3-0-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-0-1.js @@ -15,14 +15,8 @@ info: > taking 3 parameters. es5id: 15.12.3-0-1 description: JSON.stringify must exist as be a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = JSON.stringify; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-0-2.js b/test/built-ins/JSON/stringify/15.12.3-0-2.js index c3c4cad9d8..9d190846b3 100644 --- a/test/built-ins/JSON/stringify/15.12.3-0-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-0-2.js @@ -15,14 +15,9 @@ info: > taking 3 parameters. es5id: 15.12.3-0-2 description: JSON.stringify must exist as be a function taking 3 parameters -includes: [runTestCase.js] ---*/ -function testcase() { var f = JSON.stringify; - if (typeof(f) === "function" && f.length === 3) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(typeof(f), "function", 'typeof(f)'); +assert.sameValue(f.length, 3, 'f.length'); diff --git a/test/built-ins/JSON/stringify/15.12.3-0-3.js b/test/built-ins/JSON/stringify/15.12.3-0-3.js index 7024cc1ac6..35d8b2f547 100644 --- a/test/built-ins/JSON/stringify/15.12.3-0-3.js +++ b/test/built-ins/JSON/stringify/15.12.3-0-3.js @@ -8,14 +8,9 @@ info: > should be able to delete (8.6.2.5) the stringify and parse properties. es5id: 15.12.3-0-3 description: JSON.stringify must be deletable (configurable) -includes: [runTestCase.js] ---*/ -function testcase() { var o = JSON; var desc = Object.getOwnPropertyDescriptor(o, "stringify"); - if (desc.configurable === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-16.js b/test/built-ins/JSON/stringify/15.12.3-11-16.js index 5fa8d0c953..e9d92d5c2d 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-16.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-16.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property name is the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-17.js b/test/built-ins/JSON/stringify/15.12.3-11-17.js index 0d4baf8262..fe8a268b6f 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-17.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-17.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property name starts with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname": "John" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-18.js b/test/built-ins/JSON/stringify/15.12.3-11-18.js index 84d086ae86..721fe41e3c 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-18.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-18.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property name ends with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "name\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-19.js b/test/built-ins/JSON/stringify/15.12.3-11-19.js index 0b909432f8..c372e890f4 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-19.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-19.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property name starts and ends with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fname\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F": "John" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-20.js b/test/built-ins/JSON/stringify/15.12.3-11-20.js index 202b56b12a..6b7c2e6f4f 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-20.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-20.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property name middles with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "na\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fme": "John" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-21.js b/test/built-ins/JSON/stringify/15.12.3-11-21.js index 31a5b1f4d3..e22b848cc9 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-21.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-21.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property value is the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-22.js b/test/built-ins/JSON/stringify/15.12.3-11-22.js index ec098fe2cf..238b6c35f7 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-22.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-22.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property value starts with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-23.js b/test/built-ins/JSON/stringify/15.12.3-11-23.js index 1e96c398cf..c19435273b 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-23.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-23.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property value ends with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "name": "John\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-24.js b/test/built-ins/JSON/stringify/15.12.3-11-24.js index adc93f6c63..17a9c9631e 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-24.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-24.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property value starts and ends with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "name": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001FJohn\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-25.js b/test/built-ins/JSON/stringify/15.12.3-11-25.js index 73241b44fe..146d71200e 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-25.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-25.js @@ -7,11 +7,8 @@ description: > JSON.stringify - stringifying an object where property value middles with the union of all null character (The abstract operation Quote(value) step 2.c) -includes: [runTestCase.js] ---*/ -function testcase() { - var result = true; var expectedNullChars = new Array(); @@ -53,6 +50,5 @@ function testcase() { var str = JSON.stringify({ "name": "Jo\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001Fhn" }); result = (result && str.indexOf(expectedNullChars[index]) !== -1 && str.indexOf(expectedNullChars[index]) !== -1); } - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/JSON/stringify/15.12.3-11-26.js b/test/built-ins/JSON/stringify/15.12.3-11-26.js index bb4f8b06cd..a04f354a09 100644 --- a/test/built-ins/JSON/stringify/15.12.3-11-26.js +++ b/test/built-ins/JSON/stringify/15.12.3-11-26.js @@ -6,16 +6,13 @@ es5id: 15.12.3-11-26 description: > JSON.stringify - the last element of the concatenation is ']' (The abstract operation JA(value) step 10.b.iii) -includes: [runTestCase.js] ---*/ -function testcase() { var arrObj = []; arrObj[0] = "a"; arrObj[1] = "b"; arrObj[2] = "c"; var jsonText = JSON.stringify(arrObj, undefined, "").toString(); - return jsonText.charAt(jsonText.length - 1) === "]"; - } -runTestCase(testcase); + +assert.sameValue(jsonText.charAt(jsonText.length - 1), "]", 'jsonText.charAt(jsonText.length - 1)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js b/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js index 0ba497233c..719f653c9f 100644 --- a/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-5-a-i-1.js @@ -6,11 +6,8 @@ es5id: 15.12.3-5-a-i-1 description: > JSON.stringify converts Number wrapper object space aruguments to Number values -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, new Number(5))=== JSON.stringify(obj,null, 5); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj,null, new Number(5)), JSON.stringify(obj,null, 5), 'JSON.stringify(obj,null, new Number(5))'); diff --git a/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js b/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js index 4d569cebc0..034123aec1 100644 --- a/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-5-b-i-1.js @@ -6,11 +6,8 @@ es5id: 15.12.3-5-b-i-1 description: > JSON.stringify converts String wrapper object space aruguments to String values -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, new String('xxx'))=== JSON.stringify(obj,null, 'xxx'); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj,null, new String('xxx')), JSON.stringify(obj,null, 'xxx'), 'JSON.stringify(obj,null, new String("xxx"))'); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-a-1.js b/test/built-ins/JSON/stringify/15.12.3-6-a-1.js index bfbc96c376..fd0d4ded4b 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-a-1.js @@ -6,11 +6,8 @@ es5id: 15.12.3-6-a-1 description: > JSON.stringify treats numeric space arguments greater than 10 the same as a space argument of 10. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, 10)=== JSON.stringify(obj,null, 100); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj,null, 10), JSON.stringify(obj,null, 100), 'JSON.stringify(obj,null, 10)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-a-2.js b/test/built-ins/JSON/stringify/15.12.3-6-a-2.js index 141f080c9f..1cfe50a805 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-a-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-a-2.js @@ -6,11 +6,8 @@ es5id: 15.12.3-6-a-2 description: > JSON.stringify truccates non-integer numeric space arguments to their integer part. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, 5.99999)=== JSON.stringify(obj,null, 5); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj,null, 5.99999), JSON.stringify(obj,null, 5), 'JSON.stringify(obj,null, 5.99999)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-6-b-4.js b/test/built-ins/JSON/stringify/15.12.3-6-b-4.js index 8db59f3f41..de03303674 100644 --- a/test/built-ins/JSON/stringify/15.12.3-6-b-4.js +++ b/test/built-ins/JSON/stringify/15.12.3-6-b-4.js @@ -6,13 +6,10 @@ es5id: 15.12.3-6-b-4 description: > JSON.stringify treats numeric space arguments (in the range 1..10) is equivalent to a string of spaces of that length. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; var fiveSpaces = ' '; // '12345' - return JSON.stringify(obj,null, 5)=== JSON.stringify(obj, null, fiveSpaces); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj,null, 5), JSON.stringify(obj, null, fiveSpaces), 'JSON.stringify(obj,null, 5)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-7-a-1.js b/test/built-ins/JSON/stringify/15.12.3-7-a-1.js index 7bc2219382..e16a25e6f9 100644 --- a/test/built-ins/JSON/stringify/15.12.3-7-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-7-a-1.js @@ -6,11 +6,8 @@ es5id: 15.12.3-7-a-1 description: > JSON.stringify only uses the first 10 characters of a string space arguments. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj,null, '0123456789xxxxxxxxx')=== JSON.stringify(obj,null, '0123456789'); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj,null, '0123456789xxxxxxxxx'), JSON.stringify(obj,null, '0123456789'), 'JSON.stringify(obj,null, "0123456789xxxxxxxxx")'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-1.js b/test/built-ins/JSON/stringify/15.12.3-8-a-1.js index 18d42c3086..c95e950e61 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-1.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-1.js @@ -6,11 +6,8 @@ es5id: 15.12.3-8-a-1 description: > JSON.stringify treats an empty string space argument the same as a missing space argument. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj)=== JSON.stringify(obj,null, ''); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, ''), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-2.js b/test/built-ins/JSON/stringify/15.12.3-8-a-2.js index 71390ef9e0..0443eb753a 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-2.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-2.js @@ -6,11 +6,8 @@ es5id: 15.12.3-8-a-2 description: > JSON.stringify treats an Boolean space argument the same as a missing space argument. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj)=== JSON.stringify(obj,null, true); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, true), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-3.js b/test/built-ins/JSON/stringify/15.12.3-8-a-3.js index 34abae50d5..6d4bc3eb86 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-3.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-3.js @@ -6,11 +6,8 @@ es5id: 15.12.3-8-a-3 description: > JSON.stringify treats an null space argument the same as a missing space argument. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj)=== JSON.stringify(obj,null, null); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, null), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-4.js b/test/built-ins/JSON/stringify/15.12.3-8-a-4.js index 7de51bb508..d13b9c5c80 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-4.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-4.js @@ -6,11 +6,8 @@ es5id: 15.12.3-8-a-4 description: > JSON.stringify treats an Boolean wrapper space argument the same as a missing space argument. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj)=== JSON.stringify(obj,null, new Boolean(true)); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, new Boolean(true)), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3-8-a-5.js b/test/built-ins/JSON/stringify/15.12.3-8-a-5.js index eb1cca478c..56532c4ecc 100644 --- a/test/built-ins/JSON/stringify/15.12.3-8-a-5.js +++ b/test/built-ins/JSON/stringify/15.12.3-8-a-5.js @@ -6,11 +6,8 @@ es5id: 15.12.3-8-a-5 description: > JSON.stringify treats non-Number or String object space arguments the same as a missing space argument. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; - return JSON.stringify(obj)=== JSON.stringify(obj,null, obj); - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify(obj), JSON.stringify(obj,null, obj), 'JSON.stringify(obj)'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js index c456d0bb65..6f6fa62da5 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-1.js @@ -6,14 +6,11 @@ es5id: 15.12.3_2-2-b-i-1 description: > JSON.stringify converts string wrapper objects returned from a toJSON call to literal strings. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop:42, toJSON: function () {return 'fortytwo objects'} }; - return JSON.stringify([obj]) === '["fortytwo objects"]'; - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify([obj]), '["fortytwo objects"]', 'JSON.stringify([obj])'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js index 3c00242197..b665d80044 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-2.js @@ -6,14 +6,11 @@ es5id: 15.12.3_2-2-b-i-2 description: > JSON.stringify converts Number wrapper objects returned from a toJSON call to literal Number. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop:42, toJSON: function () {return new Number(42)} }; - return JSON.stringify([obj]) === '[42]'; - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify([obj]), '[42]', 'JSON.stringify([obj])'); diff --git a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js index f6d257d4c5..9a192f26c1 100644 --- a/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js +++ b/test/built-ins/JSON/stringify/15.12.3_2-2-b-i-3.js @@ -6,14 +6,11 @@ es5id: 15.12.3_2-2-b-i-3 description: > JSON.stringify converts Boolean wrapper objects returned from a toJSON call to literal Boolean values. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop:42, toJSON: function () {return new Boolean(true)} }; - return JSON.stringify([obj]) === '[true]'; - } -runTestCase(testcase); + +assert.sameValue(JSON.stringify([obj]), '[true]', 'JSON.stringify([obj])');