diff --git a/test/built-ins/JSON/15.12-0-1.js b/test/built-ins/JSON/15.12-0-1.js index fd328be0c8e0b4a53265822e08d98146ee8a8bfc..0a236cc59d5769a6f98f710210339265316c80c5 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 d4abddac7c4089849bcae755a74dab8054234b30..d9f92a391c2d26ac81d1b0eda444c752de10c100 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 bd538d60809b738032d22f798c25268a8350917a..e669bb290ef382e2d7cf61a902b7729b334fcf03 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 bc4e2992610b7d4eadb9eebaac5cff6bfb186c3a..f6170a03baa237b4e5e54b1c3340ca0ce6475f76 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 c9eb96bad313196d0d54bdd20679dc7400c54eb5..5d2ec29b383f7d818e1343dcb73156900ea9945b 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 fca893970fbd328ba26a7203d9519a3b0c8a85fc..7ff0289a9a6541da9c0b27ededbae094a8545c01 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 a8b4a6e75bc68f47e058aa42cbef0f072c374cca..c3603de047b1c6fdb819ca9e1f73770866c61dd1 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 c3c4cad9d8cd119be5feb2c9f295fc92f369ba53..9d190846b334d87a0f6549f2399f6e9003a08e26 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 7024cc1ac6733afd1c8010f017e77c8e3dbeef2e..35d8b2f547ad9b2a478ec9a0cf65e7ac2692103c 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 5fa8d0c9536ad50094a2c9725d54886d459986f0..e9d92d5c2dba3b6b441938ce0b465f113d427b00 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 0d4baf82620de4ab6d8067c05bb0a99be3d4c1ac..fe8a268b6fa51a3881441b5d2eb014441812088b 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 84d086ae86c26c0c4704adf55769bee09b904aea..721fe41e3c58fd5d773113cd9457875da2291b5e 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 0b909432f83cceb99be31b777bca904ab1ece1b7..c372e890f420498a8af51095f05bf0da84b492a4 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 202b56b12a9658d25029d4f47a931e1217a50589..6b7c2e6f4f9bad5bc1fb3af4c7acee840fa834f3 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 31a5b1f4d327fb39c5202ff689789728f6a688eb..e22b848cc97221e9bb9f6bdcd014fb6c6381885f 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 ec098fe2cfb716b197a16254b26fa86987ec9ff0..238b6c35f7cfde5ab6254d50ba4c891c0c149ab7 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 1e96c398cf51455889cd61dd848a321889243f53..c19435273b6438a01d5e5bc4a33915a572ae2c13 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 adc93f6c63896abcf87d930c249e2391d7486057..17a9c9631e5375609428a82c92fb5f88a26a32c2 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 73241b44feddd8eceae45ef81ec448938e8fdc59..146d71200ebd7d25e55da71dbc8a43117a05b3e5 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 bb4f8b06cd9aacda04758b16290fe700911aafa3..a04f354a098170238eabc589e5c44f6c2c499437 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 0ba497233c1b853599f497e4c397cbc6d5a74220..719f653c9f42ec26288dfc046e48380156defa8b 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 4d569cebc0c4818766e1c8303f4026c9e3d20984..034123aec18624d3cbe726a826326b537dd8166b 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 bfbc96c376ba69a06095e5b8710b563f5f6a6865..fd0d4ded4bc661b563f4b5b64276aad30b80660c 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 141f080c9f875d265e9e5ca5478cdd5acba96cc1..1cfe50a805e12491c66f7893b2505ed061892660 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 8db59f3f4100fa844d6c61fe5a87122a36a3d498..de033036742cd7bf9511048a260d4cfa1c40f410 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 7bc22193826d93f8005e1392102f3e0aaa659cf8..e16a25e6f905bf526a959c939da578fcdb972a31 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 18d42c3086938cc17c0b51284cae79f7958af295..c95e950e615d1d1f10d10cf74c9cddac1dcee2f8 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 71390ef9e03f723e2b45340e22df6ac2969c00fb..0443eb753ac0299ded060fca80cd3f39ac383f6e 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 34abae50d519dc04033f6e27cdeedf476b1fbee0..6d4bc3eb86c3b845f07bbe805f09940344ddd50d 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 7de51bb5088bb4102accdf39423e1816b711c1ea..d13b9c5c80433cab05d92301c6da5d5cb6b083d7 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 eb1cca478cb1e73aa8d9442345fbf84b58403904..56532c4ecc27e0ea20b1cbd350d4b09c81c7f06b 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 c456d0bb657d57e357589ce3a6bdd79f65bd0cac..6f6fa62da5c1782c5d07fa6e970a972198a34654 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 3c002421976ab06cd5f4df02a50e0a1bd5c9f40f..b665d80044c0899da501d028addca9960826c505 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 f6d257d4c5a1c3a09645823e606106c2e3f0033e..9a192f26c13bc164f3e9a79fb6297680254f6b50 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])');