From b1ecdd00e822d881cf56ef53bf8f10e4c747fa3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:23:58 +0200 Subject: [PATCH 1/9] Replace runTestCase with assert helpers [test/built-ins/String] --- test/built-ins/String/15.5.5.5.2-1-1.js | 9 ++------- test/built-ins/String/15.5.5.5.2-1-2.js | 9 ++------- test/built-ins/String/15.5.5.5.2-3-1.js | 9 ++------- test/built-ins/String/15.5.5.5.2-3-2.js | 9 ++------- test/built-ins/String/15.5.5.5.2-3-3.js | 8 +------- test/built-ins/String/15.5.5.5.2-3-4.js | 8 +------- test/built-ins/String/15.5.5.5.2-3-5.js | 8 +------- test/built-ins/String/15.5.5.5.2-3-6.js | 8 +------- test/built-ins/String/15.5.5.5.2-3-7.js | 8 +------- test/built-ins/String/15.5.5.5.2-3-8.js | 8 +------- test/built-ins/String/15.5.5.5.2-7-1.js | 8 +------- test/built-ins/String/15.5.5.5.2-7-2.js | 8 +------- test/built-ins/String/15.5.5.5.2-7-3.js | 8 +------- test/built-ins/String/15.5.5.5.2-7-4.js | 8 +------- .../endsWith/String.prototype.endsWith_Fail.js | 8 +------- .../endsWith/String.prototype.endsWith_Fail_2.js | 8 +------- .../endsWith/String.prototype.endsWith_Success.js | 8 +------- .../endsWith/String.prototype.endsWith_Success_2.js | 8 +------- .../endsWith/String.prototype.endsWith_Success_3.js | 8 +------- .../endsWith/String.prototype.endsWith_Success_4.js | 8 +------- .../String.prototype.includes_FailBadLocation.js | 8 +------- .../includes/String.prototype.includes_FailLocation.js | 8 +------- .../String.prototype.includes_FailMissingLetter.js | 8 +------- .../includes/String.prototype.includes_Success.js | 8 +------- .../String.prototype.includes_SuccessNoLocation.js | 8 +------- .../includes/String.prototype.includes_lengthProp.js | 8 +------- test/built-ins/String/prototype/replace/15.5.4.11-1.js | 10 +++------- test/built-ins/String/prototype/trim/15.5.4.20-0-1.js | 9 ++------- test/built-ins/String/prototype/trim/15.5.4.20-0-2.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-1-8.js | 8 +++----- test/built-ins/String/prototype/trim/15.5.4.20-1-9.js | 7 ++----- test/built-ins/String/prototype/trim/15.5.4.20-2-38.js | 6 +----- test/built-ins/String/prototype/trim/15.5.4.20-2-39.js | 6 +----- test/built-ins/String/prototype/trim/15.5.4.20-2-40.js | 9 ++++----- test/built-ins/String/prototype/trim/15.5.4.20-2-41.js | 9 ++++----- test/built-ins/String/prototype/trim/15.5.4.20-2-43.js | 10 ++++------ test/built-ins/String/prototype/trim/15.5.4.20-2-44.js | 7 ++----- test/built-ins/String/prototype/trim/15.5.4.20-2-45.js | 7 ++----- test/built-ins/String/prototype/trim/15.5.4.20-2-46.js | 7 ++----- test/built-ins/String/prototype/trim/15.5.4.20-2-49.js | 7 ++----- test/built-ins/String/prototype/trim/15.5.4.20-2-50.js | 7 ++----- test/built-ins/String/prototype/trim/15.5.4.20-2-51.js | 7 ++----- test/built-ins/String/prototype/trim/15.5.4.20-3-1.js | 8 ++------ test/built-ins/String/prototype/trim/15.5.4.20-3-2.js | 8 ++------ test/built-ins/String/prototype/trim/15.5.4.20-3-3.js | 6 +----- test/built-ins/String/prototype/trim/15.5.4.20-3-4.js | 6 +----- test/built-ins/String/prototype/trim/15.5.4.20-3-5.js | 6 +----- test/built-ins/String/prototype/trim/15.5.4.20-3-6.js | 6 +----- test/built-ins/String/prototype/trim/15.5.4.20-3-7.js | 6 +----- test/built-ins/String/prototype/trim/15.5.4.20-4-1.js | 9 ++------- test/built-ins/String/prototype/trim/15.5.4.20-4-11.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-12.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-13.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-14.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-16.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-19.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-2.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-20.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-21.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-22.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-24.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-27.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-28.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-29.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-3.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-30.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-32.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-35.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-36.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-37.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-38.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-4.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-40.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-41.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-42.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-43.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-44.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-45.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-46.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-47.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-48.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-49.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-5.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-50.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-51.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-52.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-53.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-54.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-55.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-56.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-57.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-58.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-59.js | 9 ++------- test/built-ins/String/prototype/trim/15.5.4.20-4-6.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-60.js | 8 +------- test/built-ins/String/prototype/trim/15.5.4.20-4-8.js | 8 +------- 96 files changed, 125 insertions(+), 635 deletions(-) diff --git a/test/built-ins/String/15.5.5.5.2-1-1.js b/test/built-ins/String/15.5.5.5.2-1-1.js index 7272f6a63c..cd06724907 100644 --- a/test/built-ins/String/15.5.5.5.2-1-1.js +++ b/test/built-ins/String/15.5.5.5.2-1-1.js @@ -9,15 +9,10 @@ es5id: 15.5.5.5.2-1-1 description: > String object supports bracket notation to lookup of data properties -includes: [runTestCase.js] ---*/ -function testcase() { var s = new String("hello world"); s.foo = 1; - if (s["foo"] === 1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s["foo"], 1, 's["foo"]'); diff --git a/test/built-ins/String/15.5.5.5.2-1-2.js b/test/built-ins/String/15.5.5.5.2-1-2.js index 3dcb39432e..b822ef8a34 100644 --- a/test/built-ins/String/15.5.5.5.2-1-2.js +++ b/test/built-ins/String/15.5.5.5.2-1-2.js @@ -7,14 +7,9 @@ info: > notation to look up non numeric property names. es5id: 15.5.5.5.2-1-2 description: String value supports bracket notation to lookup data properties -includes: [runTestCase.js] ---*/ -function testcase() { var s = String("hello world"); - if (s["foo"] === undefined) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s["foo"], undefined, 's["foo"]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-1.js b/test/built-ins/String/15.5.5.5.2-3-1.js index 0329088abb..b6d265f38f 100644 --- a/test/built-ins/String/15.5.5.5.2-3-1.js +++ b/test/built-ins/String/15.5.5.5.2-3-1.js @@ -9,14 +9,9 @@ es5id: 15.5.5.5.2-3-1 description: > String object indexing returns undefined for missing data properties -includes: [runTestCase.js] ---*/ -function testcase() { var s = new String("hello world"); - if (s["foo"] === undefined) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s["foo"], undefined, 's["foo"]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-2.js b/test/built-ins/String/15.5.5.5.2-3-2.js index 6448d6bbc6..91e1b7609a 100644 --- a/test/built-ins/String/15.5.5.5.2-3-2.js +++ b/test/built-ins/String/15.5.5.5.2-3-2.js @@ -7,14 +7,9 @@ info: > notation to look up non numeric property names. es5id: 15.5.5.5.2-3-2 description: String value indexing returns undefined for missing data properties -includes: [runTestCase.js] ---*/ -function testcase() { var s = String("hello world"); - if (s["foo"] === undefined) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s["foo"], undefined, 's["foo"]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-3.js b/test/built-ins/String/15.5.5.5.2-3-3.js index 1a3278dd75..73df524aee 100644 --- a/test/built-ins/String/15.5.5.5.2-3-3.js +++ b/test/built-ins/String/15.5.5.5.2-3-3.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-3 description: > String object indexing returns undefined if the numeric index (NaN) is not an array index -includes: [runTestCase.js] ---*/ -function testcase() { var s = new String("hello world"); - if (s[NaN] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[NaN], undefined, 's[NaN]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-4.js b/test/built-ins/String/15.5.5.5.2-3-4.js index 85feb226c1..3f1a038b18 100644 --- a/test/built-ins/String/15.5.5.5.2-3-4.js +++ b/test/built-ins/String/15.5.5.5.2-3-4.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-4 description: > String object indexing returns undefined if the numeric index (Infinity) is not an array index -includes: [runTestCase.js] ---*/ -function testcase() { var s = new String("hello world"); - if (s[Infinity] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[Infinity], undefined, 's[Infinity]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-5.js b/test/built-ins/String/15.5.5.5.2-3-5.js index 5ae4f23c58..a58b645b2d 100644 --- a/test/built-ins/String/15.5.5.5.2-3-5.js +++ b/test/built-ins/String/15.5.5.5.2-3-5.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-5 description: > String object indexing returns undefined if the numeric index ( 2^32-1) is not an array index -includes: [runTestCase.js] ---*/ -function testcase() { var s = new String("hello world"); - if (s[Math.pow(2, 32)-1]===undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[Math.pow(2, 32)-1], undefined, 's[Math.pow(2, 32)-1]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-6.js b/test/built-ins/String/15.5.5.5.2-3-6.js index 05d266aa98..a285440358 100644 --- a/test/built-ins/String/15.5.5.5.2-3-6.js +++ b/test/built-ins/String/15.5.5.5.2-3-6.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-6 description: > String value indexing returns undefined if the numeric index (NaN) is not an array index -includes: [runTestCase.js] ---*/ -function testcase() { var s = String("hello world"); - if (s[NaN] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[NaN], undefined, 's[NaN]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-7.js b/test/built-ins/String/15.5.5.5.2-3-7.js index 4423b89ce0..ff60fbccb0 100644 --- a/test/built-ins/String/15.5.5.5.2-3-7.js +++ b/test/built-ins/String/15.5.5.5.2-3-7.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-7 description: > String value indexing returns undefined if the numeric index (Infinity) is not an array index -includes: [runTestCase.js] ---*/ -function testcase() { var s = String("hello world"); - if (s[Infinity] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[Infinity], undefined, 's[Infinity]'); diff --git a/test/built-ins/String/15.5.5.5.2-3-8.js b/test/built-ins/String/15.5.5.5.2-3-8.js index a768680780..e7eb2d0851 100644 --- a/test/built-ins/String/15.5.5.5.2-3-8.js +++ b/test/built-ins/String/15.5.5.5.2-3-8.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-3-8 description: > String value indexing returns undefined if the numeric index ( >= 2^32-1) is not an array index -includes: [runTestCase.js] ---*/ -function testcase() { var s = String("hello world"); - if (s[Math.pow(2, 32)-1]===undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[Math.pow(2, 32)-1], undefined, 's[Math.pow(2, 32)-1]'); diff --git a/test/built-ins/String/15.5.5.5.2-7-1.js b/test/built-ins/String/15.5.5.5.2-7-1.js index b43a7fcd9a..2b4f2493d6 100644 --- a/test/built-ins/String/15.5.5.5.2-7-1.js +++ b/test/built-ins/String/15.5.5.5.2-7-1.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-1 description: > String object indexing returns undefined if the numeric index is less than 0 -includes: [runTestCase.js] ---*/ -function testcase() { var s = new String("hello world"); - if (s[-1] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[-1], undefined, 's[-1]'); diff --git a/test/built-ins/String/15.5.5.5.2-7-2.js b/test/built-ins/String/15.5.5.5.2-7-2.js index df78c9415d..1bf9c632a9 100644 --- a/test/built-ins/String/15.5.5.5.2-7-2.js +++ b/test/built-ins/String/15.5.5.5.2-7-2.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-2 description: > String value indexing returns undefined if the numeric index is less than 0 -includes: [runTestCase.js] ---*/ -function testcase() { var s = String("hello world"); - if (s[-1] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[-1], undefined, 's[-1]'); diff --git a/test/built-ins/String/15.5.5.5.2-7-3.js b/test/built-ins/String/15.5.5.5.2-7-3.js index eb03d28d14..66d60ac03b 100644 --- a/test/built-ins/String/15.5.5.5.2-7-3.js +++ b/test/built-ins/String/15.5.5.5.2-7-3.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-3 description: > String object indexing returns undefined if the numeric index is greater than the string length -includes: [runTestCase.js] ---*/ -function testcase() { var s = new String("hello world"); - if (s[11] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[11], undefined, 's[11]'); diff --git a/test/built-ins/String/15.5.5.5.2-7-4.js b/test/built-ins/String/15.5.5.5.2-7-4.js index b13a09df56..1d06e8d9d4 100644 --- a/test/built-ins/String/15.5.5.5.2-7-4.js +++ b/test/built-ins/String/15.5.5.5.2-7-4.js @@ -9,14 +9,8 @@ es5id: 15.5.5.5.2-7-4 description: > String value indexing returns undefined if the numeric index is greater than the string length -includes: [runTestCase.js] ---*/ -function testcase() { var s = String("hello world"); - if (s[11] === undefined) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(s[11], undefined, 's[11]'); diff --git a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail.js b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail.js index 5b9b365cd2..6a9ee85854 100644 --- a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail.js +++ b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail.js @@ -4,13 +4,7 @@ /*--- author: Ryan Lewis description: endsWith should return false when called on 'word' and passed 'r'. -includes: [runTestCase.js] features: [String#endsWith] ---*/ -function testcase() { - if('word'.endsWith('r') === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.endsWith('r'), false, '"word".endsWith("r")'); diff --git a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail_2.js b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail_2.js index 19954e1cfa..0b34a7b410 100644 --- a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail_2.js +++ b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Fail_2.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > endsWith should return false when called on 'word' and passed 'd', with an endPosition of 3. -includes: [runTestCase.js] features: [String#endsWith] ---*/ -function testcase() { - if('word'.endsWith('d', 3) === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.endsWith('d', 3), false, '"word".endsWith("d", 3)'); diff --git a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success.js b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success.js index b3655ff81d..854bc56eed 100644 --- a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success.js +++ b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > endsWith should return true when called on 'word' and passed 'd' and with no endPosition (defaults to 4). -includes: [runTestCase.js] features: [String#endsWith] ---*/ -function testcase() { - if('word'.endsWith('d') === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.endsWith('d'), true, '"word".endsWith("d")'); diff --git a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_2.js b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_2.js index 1e5f5b55e9..23aba85a2f 100644 --- a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_2.js +++ b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_2.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > endsWith should return true when called on 'word' and passed 'd' and with an endPosition of 4. -includes: [runTestCase.js] features: [String#endsWith] ---*/ -function testcase() { - if('word'.endsWith('d', 4) === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.endsWith('d', 4), true, '"word".endsWith("d", 4)'); diff --git a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_3.js b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_3.js index 13613026c8..0b8ceae787 100644 --- a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_3.js +++ b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_3.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > endsWith should return true when called on 'word' and passed 'd' and with an endPosition of 25. -includes: [runTestCase.js] features: [String#endsWith] ---*/ -function testcase() { - if('word'.endsWith('d', 25) === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.endsWith('d', 25), true, '"word".endsWith("d", 25)'); diff --git a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_4.js b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_4.js index 47147e79ba..5318ce43fd 100644 --- a/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_4.js +++ b/test/built-ins/String/prototype/endsWith/String.prototype.endsWith_Success_4.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > endsWith should return true when called on 'word' and passed 'r', with an endPosition of 3. -includes: [runTestCase.js] features: [String#endsWith] ---*/ -function testcase() { - if('word'.endsWith('r', 3) === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.endsWith('r', 3), true, '"word".endsWith("r", 3)'); diff --git a/test/built-ins/String/prototype/includes/String.prototype.includes_FailBadLocation.js b/test/built-ins/String/prototype/includes/String.prototype.includes_FailBadLocation.js index 0606dd1f08..b98ebe9f55 100644 --- a/test/built-ins/String/prototype/includes/String.prototype.includes_FailBadLocation.js +++ b/test/built-ins/String/prototype/includes/String.prototype.includes_FailBadLocation.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > String should return false if a location is passed that is greather than the length of the string. -includes: [runTestCase.js] features: [String#includes] ---*/ -function testcase() { - if('word'.includes('w', 5) === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.includes('w', 5), false, '"word".includes("w", 5)'); diff --git a/test/built-ins/String/prototype/includes/String.prototype.includes_FailLocation.js b/test/built-ins/String/prototype/includes/String.prototype.includes_FailLocation.js index dbd28ae96b..c787bb81aa 100644 --- a/test/built-ins/String/prototype/includes/String.prototype.includes_FailLocation.js +++ b/test/built-ins/String/prototype/includes/String.prototype.includes_FailLocation.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > String should return false if a letter is not found in the word starting from the passed location. -includes: [runTestCase.js] features: [String#includes] ---*/ -function testcase() { - if('word'.includes('o', 3) === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.includes('o', 3), false, '"word".includes("o", 3)'); diff --git a/test/built-ins/String/prototype/includes/String.prototype.includes_FailMissingLetter.js b/test/built-ins/String/prototype/includes/String.prototype.includes_FailMissingLetter.js index 823971eada..5e468b27f6 100644 --- a/test/built-ins/String/prototype/includes/String.prototype.includes_FailMissingLetter.js +++ b/test/built-ins/String/prototype/includes/String.prototype.includes_FailMissingLetter.js @@ -4,13 +4,7 @@ /*--- author: Ryan Lewis description: String should return false if a letter is not found in the word. -includes: [runTestCase.js] features: [String#includes] ---*/ -function testcase() { - if('word'.includes('a', 0) === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.includes('a', 0), false, '"word".includes("a", 0)'); diff --git a/test/built-ins/String/prototype/includes/String.prototype.includes_Success.js b/test/built-ins/String/prototype/includes/String.prototype.includes_Success.js index 2f2635081a..cf71285b57 100644 --- a/test/built-ins/String/prototype/includes/String.prototype.includes_Success.js +++ b/test/built-ins/String/prototype/includes/String.prototype.includes_Success.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > String should return true when called on 'word' and passed 'w' and the location 0. -includes: [runTestCase.js] features: [String#includes] ---*/ -function testcase() { - if('word'.includes('w', 0) === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.includes('w', 0), true, '"word".includes("w", 0)'); diff --git a/test/built-ins/String/prototype/includes/String.prototype.includes_SuccessNoLocation.js b/test/built-ins/String/prototype/includes/String.prototype.includes_SuccessNoLocation.js index 76561aef32..3128b0100f 100644 --- a/test/built-ins/String/prototype/includes/String.prototype.includes_SuccessNoLocation.js +++ b/test/built-ins/String/prototype/includes/String.prototype.includes_SuccessNoLocation.js @@ -6,13 +6,7 @@ author: Ryan Lewis description: > String should return true when called on 'word' and passed 'w' and with no location (defaults to 0). -includes: [runTestCase.js] features: [String#includes] ---*/ -function testcase() { - if('word'.includes('w') === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.includes('w'), true, '"word".includes("w")'); diff --git a/test/built-ins/String/prototype/includes/String.prototype.includes_lengthProp.js b/test/built-ins/String/prototype/includes/String.prototype.includes_lengthProp.js index 1f15731440..999c8fc88b 100644 --- a/test/built-ins/String/prototype/includes/String.prototype.includes_lengthProp.js +++ b/test/built-ins/String/prototype/includes/String.prototype.includes_lengthProp.js @@ -4,13 +4,7 @@ /*--- author: Ryan Lewis description: String should have the property length with size of 1. -includes: [runTestCase.js] features: [String#includes] ---*/ -function testcase() { - if('word'.includes.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue('word'.includes.length, 1, '"word".includes.length'); diff --git a/test/built-ins/String/prototype/replace/15.5.4.11-1.js b/test/built-ins/String/prototype/replace/15.5.4.11-1.js index 4b736662f4..7d337df78f 100644 --- a/test/built-ins/String/prototype/replace/15.5.4.11-1.js +++ b/test/built-ins/String/prototype/replace/15.5.4.11-1.js @@ -7,12 +7,9 @@ description: > 'this' object used by the replaceValue function of a String.prototype.replace invocation flags: [noStrict] -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var retVal = 'x'.replace(/x/, function() { if (this===fnGlobalObject()) { @@ -21,6 +18,5 @@ function testcase() { return 'z'; } }); - return retVal==='y'; -} -runTestCase(testcase); + +assert.sameValue(retVal, 'y', 'retVal'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-0-1.js b/test/built-ins/String/prototype/trim/15.5.4.20-0-1.js index 3679dbb4e2..429a17b072 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-0-1.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-0-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.5.4.20-0-1 description: String.prototype.trim must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = String.prototype.trim; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-0-2.js b/test/built-ins/String/prototype/trim/15.5.4.20-0-2.js index 35ee4c7226..61b702e346 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-0-2.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.5.4.20-0-2 description: String.prototype.trim must exist as a function taking 0 parameters -includes: [runTestCase.js] ---*/ -function testcase() { - if (String.prototype.trim.length === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.length, 0, 'String.prototype.trim.length'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-1-8.js b/test/built-ins/String/prototype/trim/15.5.4.20-1-8.js index dc48907384..3b93eb1737 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-1-8.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-1-8.js @@ -6,11 +6,9 @@ es5id: 15.5.4.20-1-8 description: > String.prototype.trim works for a primitive string (value is ' abc') -includes: [runTestCase.js] ---*/ -function testcase() { var strObj = String(" abc"); - return "abc" === strObj.trim() && strObj.toString() === " abc"; - } -runTestCase(testcase); + +assert.sameValue(strObj.trim(), "abc", 'strObj.trim()'); +assert.sameValue(strObj.toString(), " abc", 'strObj.toString()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-1-9.js b/test/built-ins/String/prototype/trim/15.5.4.20-1-9.js index 176e584610..cd09927dd8 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-1-9.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-1-9.js @@ -6,11 +6,8 @@ es5id: 15.5.4.20-1-9 description: > String.prototype.trim works for a String object which value is undefined -includes: [runTestCase.js] ---*/ -function testcase() { var strObj = new String(undefined); - return strObj.trim() === "undefined"; - } -runTestCase(testcase); + +assert.sameValue(strObj.trim(), "undefined", 'strObj.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-38.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-38.js index 40f3230e98..163254129a 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-38.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-38.js @@ -6,16 +6,12 @@ es5id: 15.5.4.20-2-38 description: > String.prototype.trim - 'this' is an object which has an own toString method -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { toString: function () { return "abc"; } }; - return (String.prototype.trim.call(obj) === "abc"); - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-39.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-39.js index 23442c8caa..2536716ded 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-39.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-39.js @@ -6,16 +6,12 @@ es5id: 15.5.4.20-2-39 description: > String.prototype.trim - 'this' is an object which has an own valueOf method -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { valueOf: function () { return "abc"; } }; - return (String.prototype.trim.call(obj) === "[object Object]"); - } -runTestCase(testcase); +assert.sameValue(String.prototype.trim.call(obj), "[object Object]", 'String.prototype.trim.call(obj)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-40.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-40.js index e4ba7845e2..4edb83c727 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-40.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-40.js @@ -7,10 +7,8 @@ description: > String.prototype.trim - 'this' is an object that has an own toString method that returns an object and valueOf method that returns a primitive value -includes: [runTestCase.js] ---*/ -function testcase() { var toStringAccessed = false; var valueOfAccessed = false; var obj = { @@ -23,6 +21,7 @@ function testcase() { return "abc"; } }; - return (String.prototype.trim.call(obj) === "abc") && valueOfAccessed && toStringAccessed; - } -runTestCase(testcase); + +assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)'); +assert(valueOfAccessed, 'valueOfAccessed !== true'); +assert(toStringAccessed, 'toStringAccessed !== true'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-41.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-41.js index 98d1320055..a9233a47d1 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-41.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-41.js @@ -6,10 +6,8 @@ es5id: 15.5.4.20-2-41 description: > String.prototype.trim - 'this' is an object which has an own toString and valueOf method. -includes: [runTestCase.js] ---*/ -function testcase() { var toStringAccessed = false; var valueOfAccessed = false; var obj = { @@ -22,6 +20,7 @@ function testcase() { return "cef"; } }; - return (String.prototype.trim.call(obj) === "abc") && !valueOfAccessed && toStringAccessed; - } -runTestCase(testcase); + +assert.sameValue(String.prototype.trim.call(obj), "abc", 'String.prototype.trim.call(obj)'); +assert.sameValue(valueOfAccessed, false, 'valueOfAccessed'); +assert(toStringAccessed, 'toStringAccessed !== true'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-43.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-43.js index 238944ac27..1c9446bdc0 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-43.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-43.js @@ -7,11 +7,8 @@ description: > String.prototype.trim - 'this' is an object with an own valueOf and inherited toString methods with hint string, verify inherited toString method will be called first -includes: [runTestCase.js] ---*/ -function testcase() { - var toStringAccessed = false; var valueOfAccessed = false; @@ -30,6 +27,7 @@ function testcase() { valueOfAccessed = true; return "efg"; }; - return (String.prototype.trim.call(child) === "abc") && toStringAccessed && !valueOfAccessed; - } -runTestCase(testcase); + +assert.sameValue(String.prototype.trim.call(child), "abc", 'String.prototype.trim.call(child)'); +assert(toStringAccessed, 'toStringAccessed !== true'); +assert.sameValue(valueOfAccessed, false, 'valueOfAccessed'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-44.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-44.js index a4aa431f8d..3dbead7888 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-44.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-44.js @@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-44 description: > String.prototype.trim - 'this' is a string that contains east Asian characters (value is 'SD咕噜') -includes: [runTestCase.js] ---*/ -function testcase() { var str = "SD咕噜"; - return str.trim() === str; - } -runTestCase(testcase); + +assert.sameValue(str.trim(), str, 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-45.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-45.js index 1ac68b4ce8..c8c99d70a5 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-45.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-45.js @@ -6,12 +6,9 @@ es5id: 15.5.4.20-2-45 description: > String.prototype.trim - 'this' is a string that contains white space, character, number, object and null characters -includes: [runTestCase.js] ---*/ -function testcase() { var str = "abc" + " " + 123 + " " + {} + " " + "\u0000"; var str1 = " " + str + " "; - return str1.trim() === str; - } -runTestCase(testcase); + +assert.sameValue(str1.trim(), str, 'str1.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-46.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-46.js index ed896250a1..f68088fa36 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-46.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-46.js @@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-46 description: > String.prototype.trim - 'this' is a Function Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { var funObj = function () { return arguments; }; - return typeof(String.prototype.trim.call(funObj)) === "string"; - } -runTestCase(testcase); + +assert.sameValue(typeof(String.prototype.trim.call(funObj)), "string", 'typeof(String.prototype.trim.call(funObj))'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-49.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-49.js index bc4ad97fbc..7eb3a04b37 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-49.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-49.js @@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-49 description: > String.prototype.trim - 'this' is a RegExp Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { var regObj = new RegExp(/test/); - return String.prototype.trim.call(regObj) === "/test/"; - } -runTestCase(testcase); + +assert.sameValue(String.prototype.trim.call(regObj), "/test/", 'String.prototype.trim.call(regObj)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-50.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-50.js index da4c2d4dfd..7dff7b940f 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-50.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-50.js @@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-50 description: > String.prototype.trim - 'this' is a Error Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { var errObj = new Error("test"); - return String.prototype.trim.call(errObj) === "Error: test"; - } -runTestCase(testcase); + +assert.sameValue(String.prototype.trim.call(errObj), "Error: test", 'String.prototype.trim.call(errObj)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-2-51.js b/test/built-ins/String/prototype/trim/15.5.4.20-2-51.js index 1f069f0ada..d47c31beb8 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-2-51.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-2-51.js @@ -6,11 +6,8 @@ es5id: 15.5.4.20-2-51 description: > String.prototype.trim - 'this' is a Arguments Object that converts to a string -includes: [runTestCase.js] ---*/ -function testcase() { var argObj = function () { return arguments; } (1, 2, true); - return String.prototype.trim.call(argObj) === "[object Arguments]"; - } -runTestCase(testcase); + +assert.sameValue(String.prototype.trim.call(argObj), "[object Arguments]", 'String.prototype.trim.call(argObj)'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-1.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-1.js index 66029872e5..0d7794575a 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-1.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-1.js @@ -4,12 +4,8 @@ /*--- es5id: 15.5.4.20-3-1 description: String.prototype.trim - 'S' is a string with all LineTerminator -includes: [runTestCase.js] ---*/ -function testcase() { - var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; - return (lineTerminatorsStr.trim() === ""); - } -runTestCase(testcase); + +assert.sameValue(lineTerminatorsStr.trim(), "", 'lineTerminatorsStr.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js index 8b51fb737c..6be919fc02 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-2.js @@ -4,12 +4,8 @@ /*--- es5id: 15.5.4.20-3-2 description: String.prototype.trim - 'S' is a string with all WhiteSpace -includes: [runTestCase.js] ---*/ -function testcase() { - var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; - return (whiteSpacesStr.trim() === ""); - } -runTestCase(testcase); + +assert.sameValue(whiteSpacesStr.trim(), "", 'whiteSpacesStr.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js index a9f690d07b..94f9121bcb 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-3.js @@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-3 description: > String.prototype.trim - 'S' is a string with all union of WhiteSpace and LineTerminator -includes: [runTestCase.js] ---*/ -function testcase() { var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; var str = whiteSpacesStr + lineTerminatorsStr; - return (str.trim() === ""); - } -runTestCase(testcase); +assert.sameValue(str.trim(), "", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js index 453c1a4513..a00b8ee11d 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-4.js @@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-4 description: > String.prototype.trim - 'S' is a string start with union of all LineTerminator and all WhiteSpace -includes: [runTestCase.js] ---*/ -function testcase() { var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; var str = whiteSpacesStr + lineTerminatorsStr + "abc"; - return (str.trim() === "abc"); - } -runTestCase(testcase); +assert.sameValue(str.trim(), "abc", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js index e8263207b1..c13159165a 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-5.js @@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-5 description: > String.prototype.trim - 'S' is a string end with union of all LineTerminator and all WhiteSpace -includes: [runTestCase.js] ---*/ -function testcase() { var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; var str = "abc" + whiteSpacesStr + lineTerminatorsStr ; - return (str.trim() === "abc"); - } -runTestCase(testcase); +assert.sameValue(str.trim(), "abc", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js index 145238d45b..875d3357bb 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-6.js @@ -7,14 +7,10 @@ description: > String.prototype.trim - 'S' is a string start with union of all LineTerminator and all WhiteSpace and end with union of all LineTerminator and all WhiteSpace -includes: [runTestCase.js] ---*/ -function testcase() { var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; var str = whiteSpacesStr + lineTerminatorsStr + "abc" + whiteSpacesStr + lineTerminatorsStr; - return (str.trim() === "abc"); - } -runTestCase(testcase); +assert.sameValue(str.trim(), "abc", 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js b/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js index f8b7a4f960..65b0439f22 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-3-7.js @@ -6,14 +6,10 @@ es5id: 15.5.4.20-3-7 description: > String.prototype.trim - 'S' is a string that union of LineTerminator and WhiteSpace in the middle -includes: [runTestCase.js] ---*/ -function testcase() { var lineTerminatorsStr = "\u000A\u000D\u2028\u2029"; var whiteSpacesStr = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"; var str = "ab" + whiteSpacesStr + lineTerminatorsStr + "cd"; - return (str.trim() === str); - } -runTestCase(testcase); +assert.sameValue(str.trim(), str, 'str.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-1.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-1.js index 8064c5780b..9abc0fdfad 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-1.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-1.js @@ -6,16 +6,11 @@ es5id: 15.5.4.20-4-1 description: > String.prototype.trim handles multiline string with whitepace and lineterminators -includes: [runTestCase.js] ---*/ -function testcase() { var s = "\u0009a b\ c \u0009" - if (s.trim() === "a bc") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s.trim(), "a bc", 's.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-11.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-11.js index e8f88f47e4..f7e0b26447 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-11.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-11.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-11 description: > String.prototype.trim handles whitepace and lineterminators (abc\u0009) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u0009".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u0009".trim(), "abc", '"abc\u0009".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-12.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-12.js index a2f335d8db..3caef65790 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-12.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-12.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-12 description: > String.prototype.trim handles whitepace and lineterminators (abc\u000B) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u000B".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u000B".trim(), "abc", '"abc\u000B".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-13.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-13.js index a578d38fdf..234b364ca4 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-13.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-13.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-13 description: > String.prototype.trim handles whitepace and lineterminators (abc\u000C) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u000C".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u000C".trim(), "abc", '"abc\u000C".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-14.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-14.js index 6056f3f67f..251f1c1ed0 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-14.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-14.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-14 description: > String.prototype.trim handles whitepace and lineterminators (abc\u0020) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u0020".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u0020".trim(), "abc", '"abc\u0020".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-16.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-16.js index 5e4786665d..756aad46c5 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-16.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-16.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-16 description: > String.prototype.trim handles whitepace and lineterminators (abc\u00A0) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u00A0".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u00A0".trim(), "abc", '"abc\u00A0".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-19.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-19.js index ebbfc69d2b..6bffa4d109 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-19.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-19.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-19 description: > String.prototype.trim handles whitepace and lineterminators (\u0009abc\u0009) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u0009abc\u0009".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u0009abc\u0009".trim(), "abc", '"\u0009abc\u0009".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-2.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-2.js index 2072a27bd5..62adbfd550 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-2.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-2.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-2 description: > String.prototype.trim handles whitepace and lineterminators ( \u0009abc \u0009) -includes: [runTestCase.js] ---*/ -function testcase() { - if (" \u0009abc \u0009".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue(" \u0009abc \u0009".trim(), "abc", '" \u0009abc \u0009".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-20.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-20.js index 60b9543b4c..04e8e11cd8 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-20.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-20.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-20 description: > String.prototype.trim handles whitepace and lineterminators (\u000Babc\u000B) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Babc\u000B".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Babc\u000B".trim(), "abc", '"\u000Babc\u000B".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-21.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-21.js index e39c4ac26f..033f14ba53 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-21.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-21.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-21 description: > String.prototype.trim handles whitepace and lineterminators (\u000Cabc\u000C) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Cabc\u000C".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Cabc\u000C".trim(), "abc", '"\u000Cabc\u000C".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-22.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-22.js index 032ac8beaf..4007e5afdc 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-22.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-22.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-22 description: > String.prototype.trim handles whitepace and lineterminators (\u0020abc\u0020) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u0020abc\u0020".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u0020abc\u0020".trim(), "abc", '"\u0020abc\u0020".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-24.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-24.js index b9ccbe1545..2997d65015 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-24.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-24.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-24 description: > String.prototype.trim handles whitepace and lineterminators (\u00A0abc\u00A0) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u00A0abc\u00A0".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u00A0abc\u00A0".trim(), "abc", '"\u00A0abc\u00A0".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-27.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-27.js index a3648a57ac..0b9d1f0188 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-27.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-27.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-27 description: > String.prototype.trim handles whitepace and lineterminators (\u0009\u0009) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u0009\u0009".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u0009\u0009".trim(), "", '"\u0009\u0009".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-28.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-28.js index 976fd7fb8d..7b2643f17b 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-28.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-28.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-28 description: > String.prototype.trim handles whitepace and lineterminators (\u000B\u000B) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000B\u000B".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000B\u000B".trim(), "", '"\u000B\u000B".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-29.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-29.js index 6cebbd89ea..8f40a82f75 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-29.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-29.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-29 description: > String.prototype.trim handles whitepace and lineterminators (\u000C\u000C) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000C\u000C".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000C\u000C".trim(), "", '"\u000C\u000C".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-3.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-3.js index 93f0eb87cf..b91223a8ba 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-3.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-3.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-3 description: > String.prototype.trim handles whitepace and lineterminators (\u0009abc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u0009abc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u0009abc".trim(), "abc", '"\u0009abc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-30.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-30.js index 3a0cb4de6f..2219e34c72 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-30.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-30.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-30 description: > String.prototype.trim handles whitepace and lineterminators (\u0020\u0020) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u0020\u0020".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u0020\u0020".trim(), "", '"\u0020\u0020".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-32.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-32.js index d7b0d193ea..142ace5439 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-32.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-32.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-32 description: > String.prototype.trim handles whitepace and lineterminators (\u00A0\u00A0) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u00A0\u00A0".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u00A0\u00A0".trim(), "", '"\u00A0\u00A0".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-35.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-35.js index 667c167416..4324a99b18 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-35.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-35.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-35 description: > String.prototype.trim handles whitepace and lineterminators (ab\u0009c) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("ab\u0009c".trim() === "ab\u0009c") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("ab\u0009c".trim(), "ab\u0009c", '"ab\u0009c".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-36.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-36.js index 34723ac462..6aab569a09 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-36.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-36.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-36 description: > String.prototype.trim handles whitepace and lineterminators (ab\u000Bc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("ab\u000Bc".trim() === "ab\u000Bc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("ab\u000Bc".trim(), "ab\u000Bc", '"ab\u000Bc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-37.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-37.js index cb6c7f8e22..9c96555557 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-37.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-37.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-37 description: > String.prototype.trim handles whitepace and lineterminators (ab\u000Cc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("ab\u000Cc".trim() === "ab\u000Cc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("ab\u000Cc".trim(), "ab\u000Cc", '"ab\u000Cc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-38.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-38.js index 9f294c4214..6d8254f070 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-38.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-38.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-38 description: > String.prototype.trim handles whitepace and lineterminators (ab\u0020c) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("ab\u0020c".trim() === "ab\u0020c") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("ab\u0020c".trim(), "ab\u0020c", '"ab\u0020c".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-4.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-4.js index a9a1fdcb66..5fee51f1dc 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-4.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-4.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-4 description: > String.prototype.trim handles whitepace and lineterminators (\u000Babc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Babc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Babc".trim(), "abc", '"\u000Babc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-40.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-40.js index 59941b09d5..ca352deebc 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-40.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-40.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-40 description: > String.prototype.trim handles whitepace and lineterminators (ab\u00A0c) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("ab\u00A0c".trim() === "ab\u00A0c") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("ab\u00A0c".trim(), "ab\u00A0c", '"ab\u00A0c".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-41.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-41.js index 53f4ac0a53..acf7f33cfe 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-41.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-41.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-41 description: > String.prototype.trim handles whitepace and lineterminators (ab\u200Bc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("ab\u200Bc".trim() === "ab\u200Bc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("ab\u200Bc".trim(), "ab\u200Bc", '"ab\u200Bc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-42.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-42.js index 31ac2106ab..fe54dd19ca 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-42.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-42.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-42 description: > String.prototype.trim handles whitepace and lineterminators (ab\uFEFFc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("ab\uFEFFc".trim() === "ab\uFEFFc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("ab\uFEFFc".trim(), "ab\uFEFFc", '"ab\uFEFFc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-43.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-43.js index a1253b33ef..d475a888c5 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-43.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-43.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-43 description: > String.prototype.trim handles whitepace and lineterminators (\u000Aabc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Aabc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Aabc".trim(), "abc", '"\u000Aabc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-44.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-44.js index 23b9c7cf1f..3a368677a2 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-44.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-44.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-44 description: > String.prototype.trim handles whitepace and lineterminators (\u000Dabc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Dabc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Dabc".trim(), "abc", '"\u000Dabc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-45.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-45.js index f92d9df2a9..2a1811a92c 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-45.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-45.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-45 description: > String.prototype.trim handles whitepace and lineterminators (\u2028abc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u2028abc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u2028abc".trim(), "abc", '"\u2028abc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-46.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-46.js index f40ad4c928..20653a56d0 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-46.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-46.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-46 description: > String.prototype.trim handles whitepace and lineterminators (\u2029abc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u2029abc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u2029abc".trim(), "abc", '"\u2029abc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-47.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-47.js index 6dcf7da9dc..3ac00096a8 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-47.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-47.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-47 description: > String.prototype.trim handles whitepace and lineterminators (abc\u000A) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u000A".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u000A".trim(), "abc", '"abc\u000A".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-48.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-48.js index f16dfcf8f5..5e3bb87857 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-48.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-48.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-48 description: > String.prototype.trim handles whitepace and lineterminators (abc\u000D) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u000D".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u000D".trim(), "abc", '"abc\u000D".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-49.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-49.js index 288582b180..aff1fa5af0 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-49.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-49.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-49 description: > String.prototype.trim handles whitepace and lineterminators (abc\u2028) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u2028".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u2028".trim(), "abc", '"abc\u2028".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-5.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-5.js index 9af3935a39..b5473c26db 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-5.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-5.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-5 description: > String.prototype.trim handles whitepace and lineterminators (\u000Cabc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Cabc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Cabc".trim(), "abc", '"\u000Cabc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-50.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-50.js index 49f5dcdea5..74280cb918 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-50.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-50.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-50 description: > String.prototype.trim handles whitepace and lineterminators (abc\u2029) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("abc\u2029".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("abc\u2029".trim(), "abc", '"abc\u2029".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-51.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-51.js index daf957ec81..308a62ad23 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-51.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-51.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-51 description: > String.prototype.trim handles whitepace and lineterminators (\u000Aabc\u000A) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Aabc\u000A".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Aabc\u000A".trim(), "abc", '"\u000Aabc\u000A".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-52.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-52.js index 4b81cf24c1..846ff7e9d6 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-52.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-52.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-52 description: > String.prototype.trim handles whitepace and lineterminators (\u000Dabc\u000D) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000Dabc\u000D".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000Dabc\u000D".trim(), "abc", '"\u000Dabc\u000D".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-53.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-53.js index ff0a0b258e..97e8949f87 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-53.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-53.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-53 description: > String.prototype.trim handles whitepace and lineterminators (\u2028abc\u2028) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u2028abc\u2028".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u2028abc\u2028".trim(), "abc", '"\u2028abc\u2028".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-54.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-54.js index aa51015f48..3fab5ec6eb 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-54.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-54.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-54 description: > String.prototype.trim handles whitepace and lineterminators (\u2029abc\u2029) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u2029abc\u2029".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u2029abc\u2029".trim(), "abc", '"\u2029abc\u2029".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-55.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-55.js index 6997e3bbbc..ccbe68cbe7 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-55.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-55.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-55 description: > String.prototype.trim handles whitepace and lineterminators (\u000A\u000A) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000A\u000A".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000A\u000A".trim(), "", '"\u000A\u000A".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-56.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-56.js index b0371c1f52..2f648d6928 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-56.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-56.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-56 description: > String.prototype.trim handles whitepace and lineterminators (\u000D\u000D) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u000D\u000D".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u000D\u000D".trim(), "", '"\u000D\u000D".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-57.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-57.js index 10fe688aca..e13d6a0c08 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-57.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-57.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-57 description: > String.prototype.trim handles whitepace and lineterminators (\u2028\u2028) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u2028\u2028".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u2028\u2028".trim(), "", '"\u2028\u2028".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-58.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-58.js index f34a8b6109..b06974f583 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-58.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-58.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-58 description: > String.prototype.trim handles whitepace and lineterminators (\u2029\u2029) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u2029\u2029".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u2029\u2029".trim(), "", '"\u2029\u2029".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-59.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-59.js index b041e0ab38..13a98eb6c5 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-59.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-59.js @@ -6,14 +6,9 @@ es5id: 15.5.4.20-4-59 description: > String.prototype.trim handles whitepace and lineterminators (\u2029abc as a multiline string) -includes: [runTestCase.js] ---*/ -function testcase() { var s = "\u2029\ abc"; - if (s.trim() === "abc") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s.trim(), "abc", 's.trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-6.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-6.js index 410c064552..e37c01bbaf 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-6.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-6.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-6 description: > String.prototype.trim handles whitepace and lineterminators (\u0020abc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u0020abc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u0020abc".trim(), "abc", '"\u0020abc".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-60.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-60.js index 95af050af0..6cd066500d 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-60.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-60.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-60 description: > String.prototype.trim handles whitepace and lineterminators (string with just blanks) -includes: [runTestCase.js] ---*/ -function testcase() { - if (" ".trim() === "") { - return true; - } - } -runTestCase(testcase); +assert.sameValue(" ".trim(), "", '" ".trim()'); diff --git a/test/built-ins/String/prototype/trim/15.5.4.20-4-8.js b/test/built-ins/String/prototype/trim/15.5.4.20-4-8.js index 6b156d9952..0304afed30 100644 --- a/test/built-ins/String/prototype/trim/15.5.4.20-4-8.js +++ b/test/built-ins/String/prototype/trim/15.5.4.20-4-8.js @@ -6,12 +6,6 @@ es5id: 15.5.4.20-4-8 description: > String.prototype.trim handles whitepace and lineterminators (\u00A0abc) -includes: [runTestCase.js] ---*/ -function testcase() { - if ("\u00A0abc".trim() === "abc") { - return true; - } - } -runTestCase(testcase); +assert.sameValue("\u00A0abc".trim(), "abc", '"\u00A0abc".trim()'); From 60a2879133a0b506d943e539295c08d9378f06e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:24:22 +0200 Subject: [PATCH 2/9] Replace runTestCase with assert helpers [test/built-ins/Function] --- test/built-ins/Function/15.3.2.1-11-1.js | 6 ------ test/built-ins/Function/15.3.2.1-11-3.js | 5 ----- test/built-ins/Function/15.3.2.1-11-5.js | 6 ------ test/built-ins/Function/15.3.2.1-11-8-s.js | 7 ------- test/built-ins/Function/15.3.2.1-11-9-s.js | 5 ----- test/built-ins/Function/length/15.3.3.2-1.js | 14 ++++---------- .../Function/prototype/apply/15.3.4.3-1-s.js | 7 ++----- .../Function/prototype/apply/15.3.4.3-2-s.js | 7 ++----- .../Function/prototype/apply/15.3.4.3-3-s.js | 7 ++----- .../Function/prototype/bind/15.3.4.5-0-1.js | 8 +------- .../Function/prototype/bind/15.3.4.5-0-2.js | 8 +------- .../Function/prototype/bind/15.3.4.5-10-1.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-13.b-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-2.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-3.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-4.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-5.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-6.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-15-1.js | 13 ++++--------- .../Function/prototype/bind/15.3.4.5-15-2.js | 15 +++++---------- .../Function/prototype/bind/15.3.4.5-15-4.js | 9 +++------ .../Function/prototype/bind/15.3.4.5-15-5.js | 9 +++------ .../Function/prototype/bind/15.3.4.5-16-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-16-2.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-2-3.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-4.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-5.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-6.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-8.js | 8 +++----- .../Function/prototype/bind/15.3.4.5-2-9.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-3-1.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-1.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-12.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-5.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-9.js | 9 +++------ .../Function/prototype/bind/15.3.4.5-8-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-8-2.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-9-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-9-2.js | 9 ++------- .../Function/prototype/bind/15.3.4.5.1-4-1.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-10.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-11.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-12.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-13.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-14.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-15.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-2.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-3.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-4.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-5.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-6.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-7.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-8.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-9.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-1.js | 10 ++++------ .../Function/prototype/bind/15.3.4.5.2-4-10.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-11.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-12.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-13.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-14.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-2.js | 10 ++++------ .../Function/prototype/bind/15.3.4.5.2-4-3.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-4.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-6.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-7.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-8.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-9.js | 6 +----- .../Function/prototype/call/15.3.4.4-1-s.js | 7 ++----- .../Function/prototype/call/15.3.4.4-2-s.js | 7 ++----- .../Function/prototype/call/15.3.4.4-3-s.js | 7 ++----- 70 files changed, 117 insertions(+), 415 deletions(-) diff --git a/test/built-ins/Function/15.3.2.1-11-1.js b/test/built-ins/Function/15.3.2.1-11-1.js index 189d8e438b..8caa5e5f77 100644 --- a/test/built-ins/Function/15.3.2.1-11-1.js +++ b/test/built-ins/Function/15.3.2.1-11-1.js @@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-1 description: > Duplicate separate parameter name in Function constructor allowed if body not strict -includes: [runTestCase.js] ---*/ -function testcase() -{ Function('a','a','return;'); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-3.js b/test/built-ins/Function/15.3.2.1-11-3.js index 407029cfef..a1d3cf4316 100644 --- a/test/built-ins/Function/15.3.2.1-11-3.js +++ b/test/built-ins/Function/15.3.2.1-11-3.js @@ -6,11 +6,6 @@ es5id: 15.3.2.1-11-3 description: > Function constructor may have a formal parameter named 'eval' if body is not strict mode -includes: [runTestCase.js] ---*/ -function testcase() { Function('eval', 'return;'); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-5.js b/test/built-ins/Function/15.3.2.1-11-5.js index 6b9ad94913..90d4195724 100644 --- a/test/built-ins/Function/15.3.2.1-11-5.js +++ b/test/built-ins/Function/15.3.2.1-11-5.js @@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-5 description: > Duplicate combined parameter name in Function constructor allowed if body is not strict -includes: [runTestCase.js] ---*/ -function testcase() -{ Function('a,a','return;'); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-8-s.js b/test/built-ins/Function/15.3.2.1-11-8-s.js index e8edf84654..2795b4ddf6 100644 --- a/test/built-ins/Function/15.3.2.1-11-8-s.js +++ b/test/built-ins/Function/15.3.2.1-11-8-s.js @@ -9,13 +9,6 @@ description: > which are separated by a unique parameter name and there is no explicit 'use strict' in the function constructor's body flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = new Function("baz", "qux", "baz", "return 0;"); - return true; - - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-9-s.js b/test/built-ins/Function/15.3.2.1-11-9-s.js index ae8eea9c89..fef8fdade3 100644 --- a/test/built-ins/Function/15.3.2.1-11-9-s.js +++ b/test/built-ins/Function/15.3.2.1-11-9-s.js @@ -8,11 +8,6 @@ description: > the Function constructor that has three identical parameters and there is no explicit 'use strict' in the function constructor's body -includes: [runTestCase.js] ---*/ -function testcase() { var foo = new Function("baz", "baz", "baz", "return 0;"); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/length/15.3.3.2-1.js b/test/built-ins/Function/length/15.3.3.2-1.js index 4061a72eda..84c73661f6 100644 --- a/test/built-ins/Function/length/15.3.3.2-1.js +++ b/test/built-ins/Function/length/15.3.3.2-1.js @@ -4,17 +4,11 @@ /*--- es5id: 15.3.3.2-1 description: Function.length - data property with value 1 -includes: [runTestCase.js] ---*/ -function testcase() { - var desc = Object.getOwnPropertyDescriptor(Function,"length"); - if(desc.value === 1 && - desc.writable === false && - desc.enumerable === false && - desc.configurable === true) - return true; - } -runTestCase(testcase); +assert.sameValue(desc.value, 1, 'desc.value'); +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js b/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js index f39e6a0f07..7ee954176d 100644 --- a/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js +++ b/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called with an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof String); } - return !fun.apply("", Array); - } -runTestCase(testcase); + +assert.sameValue(fun.apply("", Array), false, 'fun.apply("", Array)'); diff --git a/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js b/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js index ecd7d1af16..a717204bd4 100644 --- a/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js +++ b/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called with an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Number); } - return !fun.apply(-12, Array); - } -runTestCase(testcase); + +assert.sameValue(fun.apply(-12, Array), false, 'fun.apply(-12, Array)'); diff --git a/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js b/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js index 3e401b0d99..762c5c5936 100644 --- a/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js +++ b/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called with an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Boolean); } - return !fun.apply(false, Array); - } -runTestCase(testcase); + +assert.sameValue(fun.apply(false, Array), false, 'fun.apply(false, Array)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js index 64b37a4f47..721390cf70 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js @@ -4,14 +4,8 @@ /*--- es5id: 15.3.4.5-0-1 description: Function.prototype.bind must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Function.prototype.bind; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js index 15e642412e..7d119fba13 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.3.4.5-0-2 description: Function.prototype.bind must exist as a function taking 1 parameter -includes: [runTestCase.js] ---*/ -function testcase() { - if (Function.prototype.bind.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Function.prototype.bind.length, 1, 'Function.prototype.bind.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js index 2639cb7257..7486fce8d4 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js @@ -6,14 +6,10 @@ es5id: 15.3.4.5-10-1 description: > Function.prototype.bind - internal property [[Class]] of 'F' is set as Function -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - return Object.prototype.toString.call(obj) === "[object Function]"; - } -runTestCase(testcase); + +assert.sameValue(Object.prototype.toString.call(obj), "[object Function]", 'Object.prototype.toString.call(obj)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js index 691d239f58..76a189908d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.3.4.5-13.b-1 description: Function.prototype.bind, bound fn has a 'length' own property -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (bf.hasOwnProperty('length')) { - return true; - } - } -runTestCase(testcase); + +assert(bf.hasOwnProperty('length'), 'bf.hasOwnProperty("length") !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js index 75311a772f..d0aedf9065 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-2 description: > Function.prototype.bind, 'length' set to remaining number of expected args -includes: [runTestCase.js] ---*/ -function testcase() { function foo(x, y) { } var o = {}; var bf = foo.bind(o); - if (bf.length === 2) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 2, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js index 050357d3bc..b2a968ed3a 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-3 description: > Function.prototype.bind, 'length' set to remaining number of expected args (all args prefilled) -includes: [runTestCase.js] ---*/ -function testcase() { function foo(x, y) { } var o = {}; var bf = foo.bind(o, 42, 101); - if (bf.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 0, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js index e2b94af54e..152d1eb8bc 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-4 description: > Function.prototype.bind, 'length' set to remaining number of expected args (target takes 0 args) -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (bf.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 0, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js index beea6de45c..fcf6139fa6 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-5 description: > Function.prototype.bind, 'length' set to remaining number of expected args (target provided extra args) -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o, 42); - if (bf.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 0, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js index a3cd85f006..038084b1aa 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-6 description: > Function.prototype.bind, 'length' set to remaining number of expected args -includes: [runTestCase.js] ---*/ -function testcase() { function foo(x, y) { } var o = {}; var bf = foo.bind(o, 42); - if (bf.length === 1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 1, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js index d1369cd85b..ff341342eb 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js @@ -4,19 +4,14 @@ /*--- es5id: 15.3.4.5-15-1 description: Function.prototype.bind, 'length' is a data valued own property -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var desc = Object.getOwnPropertyDescriptor(bf, 'length'); - if (desc.hasOwnProperty('value') === true && - desc.hasOwnProperty('get') === false && - desc.hasOwnProperty('set') === false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.hasOwnProperty('value'), true, 'desc.hasOwnProperty("value")'); +assert.sameValue(desc.hasOwnProperty('get'), false, 'desc.hasOwnProperty("get")'); +assert.sameValue(desc.hasOwnProperty('set'), false, 'desc.hasOwnProperty("set")'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js index b5f5556172..19ed95b0d1 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js @@ -5,20 +5,15 @@ es5id: 15.3.4.5-15-2 description: > Function.prototype.bind, 'length' is a data valued own property -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var desc = Object.getOwnPropertyDescriptor(bf, 'length'); - if (desc.value === 0 && - desc.enumerable === false && - desc.writable === false && - desc.configurable == true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.value, 0, 'desc.value'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js index 6e12d4557c..f0f5a41e6e 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js @@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-4 description: > Function.prototype.bind - The [[Enumerable]] attribute of length property in F set as false -includes: [runTestCase.js] ---*/ -function testcase() { - var canEnumerable = false; var hasProperty = false; function foo() { } @@ -21,6 +18,6 @@ function testcase() { canEnumerable = true; } } - return hasProperty && !canEnumerable; - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(canEnumerable, false, 'canEnumerable'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js index 389b3970c7..e18bfc126c 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js @@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-5 description: > Function.prototype.bind - The [[Configurable]] attribute of length property in F set as false -includes: [runTestCase.js] ---*/ -function testcase() { - var canConfigurable = false; var hasProperty = false; function foo() { } @@ -18,6 +15,6 @@ function testcase() { hasProperty = obj.hasOwnProperty("length"); delete obj.caller; canConfigurable = !obj.hasOwnProperty("length"); - return hasProperty && !canConfigurable; - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(canConfigurable, false, 'canConfigurable'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js index 95d1fde645..385cc179a3 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js @@ -4,17 +4,12 @@ /*--- es5id: 15.3.4.5-16-1 description: Function.prototype.bind, [[Extensible]] of the bound fn is true -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var ex = Object.isExtensible(bf); - if (ex === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(ex, true, 'ex'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js index 72c2c728db..0a1d795413 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js @@ -6,14 +6,10 @@ es5id: 15.3.4.5-16-2 description: > Function.prototype.bind - The [[Extensible]] attribute of internal property in F set as true -includes: [runTestCase.js] ---*/ -function testcase() { - function foo() { } var obj = foo.bind({}); obj.property = 12; - return obj.hasOwnProperty("property"); - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js index 210b25afea..42f593c0e7 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-3 description: Function.prototype.bind allows Target to be a constructor (Number) -includes: [runTestCase.js] ---*/ -function testcase() { var bnc = Number.bind(null); var n = bnc(42); - if (n === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(n, 42, 'n'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js index 6764bf45ae..f12ad20c9d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-4 description: Function.prototype.bind allows Target to be a constructor (String) -includes: [runTestCase.js] ---*/ -function testcase() { var bsc = String.bind(null); var s = bsc("hello world"); - if (s === "hello world") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s, "hello world", 's'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js index 1937bff3f2..2ff1bb4232 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-5 description: Function.prototype.bind allows Target to be a constructor (Boolean) -includes: [runTestCase.js] ---*/ -function testcase() { var bbc = Boolean.bind(null); var b = bbc(true); - if (b === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(b, true, 'b'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js index ad9c06c450..585ebada93 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-6 description: Function.prototype.bind allows Target to be a constructor (Object) -includes: [runTestCase.js] ---*/ -function testcase() { var boc = Object.bind(null); var o = boc(42); - if (o == 42) { - return true; - } - } -runTestCase(testcase); + +assert((o == 42), '(o == 42) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js index 0341e9a7f2..44e02b0feb 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js @@ -7,15 +7,13 @@ info: > is not callable. es5id: 15.3.4.5-2-8 description: Function.prototype.bind allows Target to be a constructor (Array) -includes: [runTestCase.js] ---*/ -function testcase() { var bac = Array.bind(null); var a = bac(42); a.prop = "verifyPropertyExist"; a[41] = 41; - return a.prop === "verifyPropertyExist" && a[41] === 41 && a.length === 42; - } -runTestCase(testcase); +assert.sameValue(a.prop, "verifyPropertyExist", 'a.prop'); +assert.sameValue(a[41], 41, 'a[41]'); +assert.sameValue(a.length, 42, 'a.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js index e1d170bd17..337e8b6da2 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js @@ -4,14 +4,9 @@ /*--- es5id: 15.3.4.5-2-9 description: Function.prototype.bind allows Target to be a constructor (Date) -includes: [runTestCase.js] ---*/ -function testcase() { var bdc = Date.bind(null); var s = bdc(0, 0, 0); - if (typeof(s) === 'string') { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(s), 'string', 'typeof(s)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js index b965110c37..0a88f6d3b7 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js @@ -4,17 +4,13 @@ /*--- es5id: 15.3.4.5-3-1 description: Function.prototype.bind - each arg is defined in A in list order -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function (x, y) { return new Boolean((x + y) === "ab" && arguments[0] === "a" && arguments[1] === "b" && arguments.length === 2); }; var obj = foo.bind({}, "a", "b"); - return obj()==true; - } -runTestCase(testcase); + +assert((obj() == true), '(obj() == true) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js index ccd2a6e634..89e32473e2 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js @@ -4,15 +4,11 @@ /*--- es5id: 15.3.4.5-6-1 description: Function.prototype.bind - F can get own data property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); obj.property = 12; - return obj.property === 12; - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js index c3b423b976..416294bc0d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js @@ -4,14 +4,10 @@ /*--- es5id: 15.3.4.5-6-12 description: Function.prototype.bind - F cannot get property which doesn't exist -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - return typeof (obj.property) === "undefined"; - } -runTestCase(testcase); + +assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js index ef978517e1..e75c71ee19 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js @@ -4,11 +4,8 @@ /*--- es5id: 15.3.4.5-6-5 description: Function.prototype.bind - F can get own accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); @@ -17,6 +14,5 @@ function testcase() { return 12; } }); - return obj.property === 12; - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js index 53c8ed36d4..bedb8acfb8 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js @@ -6,17 +6,14 @@ es5id: 15.3.4.5-6-9 description: > Function.prototype.bind - F can get own accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); Object.defineProperty(obj, "property", { set: function () {} }); - return obj.hasOwnProperty("property") && typeof (obj.property) === "undefined"; - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js index cef3e444c8..3ef542bdc8 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.3.4.5-8-1 description: Function.prototype.bind, type of bound function must be 'function' -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (typeof(bf) === 'function') { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(bf), 'function', 'typeof(bf)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js index afd7c22554..cc9ca589be 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js @@ -6,17 +6,12 @@ es5id: 15.3.4.5-8-2 description: > Function.prototype.bind, [[Class]] of bound function must be 'Function' -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var s = Object.prototype.toString.call(bf); - if (s === '[object Function]') { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s, '[object Function]', 's'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js index 4713401c5e..ff231a57bc 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.3.4.5-9-1 description: Function.prototype.bind, [[Prototype]] is Function.prototype -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (Function.prototype.isPrototypeOf(bf)) { - return true; - } - } -runTestCase(testcase); + +assert(Function.prototype.isPrototypeOf(bf), 'Function.prototype.isPrototypeOf(bf) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js index 4ba8bfb70b..597e3ca158 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-9-2 description: > Function.prototype.bind, [[Prototype]] is Function.prototype (using getPrototypeOf) -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (Object.getPrototypeOf(bf) === Function.prototype) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(Object.getPrototypeOf(bf), Function.prototype, 'Object.getPrototypeOf(bf)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js index 01bc793149..9d386aa4fd 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js @@ -7,16 +7,12 @@ description: > [[Call]] - 'F''s [[BoundArgs]] is used as the former part of arguments of calling the [[Call]] internal method of 'F''s [[TargetFunction]] when 'F' is called -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { return x + y + z; }; var newFunc = Function.prototype.bind.call(func, {}, "a", "b", "c"); - return newFunc() === "abc"; - } -runTestCase(testcase); +assert.sameValue(newFunc(), "abc", 'newFunc()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js index 28b861ff2a..13c4a05bc7 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-10 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js index 4b0772ee8b..162dfdbc2c 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-11 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(1); - } -runTestCase(testcase); +assert(newFunc(1), 'newFunc(1) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js index b05454d8fc..0185bd3e22 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-12 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 2, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(1, 2); - } -runTestCase(testcase); +assert(newFunc(1, 2), 'newFunc(1, 2) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js index 15d41c24d1..477b95d8ed 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-13 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js index 57a637d71a..ed401e8b60 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-14 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(2); - } -runTestCase(testcase); +assert(newFunc(2), 'newFunc(2) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js index f953a00c5b..772059d8fd 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-15 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 2, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1, 2); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js index 5595ea541e..329b1e78c5 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js @@ -7,10 +7,8 @@ description: > [[Call]] - 'F''s [[BoundThis]] is used as the 'this' value of calling the [[Call]] internal method of 'F''s [[TargetFunction]] when 'F' is called -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "prop": "a" }; var func = function () { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc() === obj; - } -runTestCase(testcase); +assert.sameValue(newFunc(), obj, 'newFunc()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js index 6ab430e7fa..c0bb824d0a 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js @@ -7,16 +7,12 @@ description: > [[Call]] - the provided arguments is used as the latter part of arguments of calling the [[Call]] internal method of 'F''s [[TargetFunction]] when 'F' is called -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { return z; }; var newFunc = Function.prototype.bind.call(func, {}, "a", "b"); - return newFunc("c") === "c"; - } -runTestCase(testcase); +assert.sameValue(newFunc("c"), "c", 'newFunc("c")'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js index 2dd9c95344..829615fff5 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js @@ -7,16 +7,12 @@ description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return arguments.length === 0; }; var newFunc = Function.prototype.bind.call(func); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js index 0afb26fe71..7342bbdd38 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js @@ -7,16 +7,12 @@ description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return arguments[0] === 1; }; var newFunc = Function.prototype.bind.call(func); - return newFunc(1); - } -runTestCase(testcase); +assert(newFunc(1), 'newFunc(1) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js index c2af948ce9..88da5973ce 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-6 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js index 3a8724c357..2e90afd021 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-7 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js index 18773caadb..7203696e82 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-8 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(1); - } -runTestCase(testcase); +assert(newFunc(1), 'newFunc(1) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js index 014b48640d..496a18584f 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-9 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(2); - } -runTestCase(testcase); +assert(newFunc(2), 'newFunc(2) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js index 82b394e80d..5088d7335c 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js @@ -7,10 +7,8 @@ description: > [[Construct]] - 'F''s [[BoundArgs]] is used as the former part of arguments of calling the [[Construct]] internal method of 'F''s [[TargetFunction]] when 'F' is called as constructor -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { var objResult = {}; objResult.returnValue = x + y + z; @@ -22,7 +20,7 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" && - newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true; - } -runTestCase(testcase); +assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true'); +assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue'); +assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true'); +assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js index c7243f68c2..c3a9014e1d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-10 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(1); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js index 58252a450f..1d385d0819 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-11 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 2 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(1, 2); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js index 293c7567c8..2a3ab1bf23 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-12 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js index 327f63551d..ad86f0904e 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-13 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(2); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js index 0b42174daa..e893ad5a8e 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-14 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 2, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js index f203a43dda..cdee9fae61 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js @@ -7,10 +7,8 @@ description: > [[Construct]] - the provided arguments is used as the latter part of arguments of calling the [[Construct]] internal method of 'F''s [[TargetFunction]] when 'F' is called as constructor -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { var objResult = {}; objResult.returnValue = x + y + z; @@ -22,7 +20,7 @@ function testcase() { var newInstance = new NewFunc("a", "b", "c"); - return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" && - newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true; - } -runTestCase(testcase); +assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true'); +assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue'); +assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true'); +assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js index e49b5af510..535e38e0e9 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js @@ -7,10 +7,8 @@ description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 0); }; @@ -19,6 +17,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js index 0e898b9ab7..2fdf32fd38 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js @@ -7,10 +7,8 @@ description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments[0] === 1 && arguments.length === 1); }; @@ -19,6 +17,4 @@ function testcase() { var newInstance = new NewFunc(1); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js index 0e5da98777..1afb3b7cf5 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-6 description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js index b662d1471c..085e9545e6 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-7 description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(1); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js index 570a43462c..4207a187cf 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-8 description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 2 && arguments[0] === 1 && arguments[1] === 2); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(2); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js index 3bca8e3c73..4c25b405d9 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-9 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 0 && typeof x === "undefined"); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js b/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js index 4a8d8d0639..a4f618bb16 100644 --- a/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js +++ b/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called without an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof String); } - return !fun.call(""); - } -runTestCase(testcase); + +assert.sameValue(fun.call(""), false, 'fun.call("")'); diff --git a/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js b/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js index 1603a9ea25..687003b5cd 100644 --- a/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js +++ b/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called without an array argument flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Number); } - return !fun.call(-12); - } -runTestCase(testcase); + +assert.sameValue(fun.call(-12), false, 'fun.call(-12)'); diff --git a/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js b/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js index 9f79f2cac7..a92bdea11d 100644 --- a/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js +++ b/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called without an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Boolean); } - return !fun.call(false); - } -runTestCase(testcase); + +assert.sameValue(fun.call(false), false, 'fun.call(false)'); From cf231fb03bced9dcb8d77148f50ce79c74675810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:24:55 +0200 Subject: [PATCH 3/9] Replace runTestCase with assert helpers [test/built-ins/Error] --- test/built-ins/Error/prototype/toString/15.11.4.4-10-1.js | 7 ++----- test/built-ins/Error/prototype/toString/15.11.4.4-6-1.js | 7 ++----- test/built-ins/Error/prototype/toString/15.11.4.4-6-2.js | 7 ++----- test/built-ins/Error/prototype/toString/15.11.4.4-8-1.js | 7 ++----- test/built-ins/Error/prototype/toString/15.11.4.4-9-1.js | 7 ++----- 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/test/built-ins/Error/prototype/toString/15.11.4.4-10-1.js b/test/built-ins/Error/prototype/toString/15.11.4.4-10-1.js index 562d06e6f4..dd30cf0ea1 100644 --- a/test/built-ins/Error/prototype/toString/15.11.4.4-10-1.js +++ b/test/built-ins/Error/prototype/toString/15.11.4.4-10-1.js @@ -7,12 +7,9 @@ description: > Error.prototype.toString return the result of concatenating 'name', ':', a single space character, and 'msg' when 'name' and 'msg' are non-empty string -includes: [runTestCase.js] ---*/ -function testcase() { var errObj = new Error("ErrorMessage"); errObj.name = "ErrorName"; - return errObj.toString() === "ErrorName: ErrorMessage"; - } -runTestCase(testcase); + +assert.sameValue(errObj.toString(), "ErrorName: ErrorMessage", 'errObj.toString()'); diff --git a/test/built-ins/Error/prototype/toString/15.11.4.4-6-1.js b/test/built-ins/Error/prototype/toString/15.11.4.4-6-1.js index 05979a1847..efd54b91de 100644 --- a/test/built-ins/Error/prototype/toString/15.11.4.4-6-1.js +++ b/test/built-ins/Error/prototype/toString/15.11.4.4-6-1.js @@ -6,11 +6,8 @@ es5id: 15.11.4.4-6-1 description: > Error.prototype.toString - 'Error' is returned when 'name' is absent and empty string is returned when 'msg' is undefined -includes: [runTestCase.js] ---*/ -function testcase() { var errObj = new Error(); - return errObj.toString() === "Error"; - } -runTestCase(testcase); + +assert.sameValue(errObj.toString(), "Error", 'errObj.toString()'); diff --git a/test/built-ins/Error/prototype/toString/15.11.4.4-6-2.js b/test/built-ins/Error/prototype/toString/15.11.4.4-6-2.js index e4874d3203..28db42997e 100644 --- a/test/built-ins/Error/prototype/toString/15.11.4.4-6-2.js +++ b/test/built-ins/Error/prototype/toString/15.11.4.4-6-2.js @@ -7,11 +7,8 @@ description: > Error.prototype.toString - 'Error' is returned when 'name' is absent and value of 'msg' is returned when 'msg' is non-empty string -includes: [runTestCase.js] ---*/ -function testcase() { var errObj = new Error("ErrorMessage"); - return errObj.toString() === "Error: ErrorMessage"; - } -runTestCase(testcase); + +assert.sameValue(errObj.toString(), "Error: ErrorMessage", 'errObj.toString()'); diff --git a/test/built-ins/Error/prototype/toString/15.11.4.4-8-1.js b/test/built-ins/Error/prototype/toString/15.11.4.4-8-1.js index df58cc1d7b..835145acb1 100644 --- a/test/built-ins/Error/prototype/toString/15.11.4.4-8-1.js +++ b/test/built-ins/Error/prototype/toString/15.11.4.4-8-1.js @@ -6,12 +6,9 @@ es5id: 15.11.4.4-8-1 description: > Error.prototype.toString return the value of 'msg' when 'name' is empty string and 'msg' isn't undefined -includes: [runTestCase.js] ---*/ -function testcase() { var errObj = new Error("ErrorMessage"); errObj.name = ""; - return errObj.toString() === "ErrorMessage"; - } -runTestCase(testcase); + +assert.sameValue(errObj.toString(), "ErrorMessage", 'errObj.toString()'); diff --git a/test/built-ins/Error/prototype/toString/15.11.4.4-9-1.js b/test/built-ins/Error/prototype/toString/15.11.4.4-9-1.js index c1534b2b37..2f86f3150a 100644 --- a/test/built-ins/Error/prototype/toString/15.11.4.4-9-1.js +++ b/test/built-ins/Error/prototype/toString/15.11.4.4-9-1.js @@ -6,12 +6,9 @@ es5id: 15.11.4.4-9-1 description: > Error.prototype.toString return 'name' when 'name' is non-empty string and 'msg' is empty string -includes: [runTestCase.js] ---*/ -function testcase() { var errObj = new Error(); errObj.name = "ErrorName"; - return errObj.toString() === "ErrorName"; - } -runTestCase(testcase); + +assert.sameValue(errObj.toString(), "ErrorName", 'errObj.toString()'); From bec8782918a389d097912447f36ccc65fd24cca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:25:18 +0200 Subject: [PATCH 4/9] Replace runTestCase with assert helpers [test/built-ins/Date] --- test/built-ins/Date/15.9.1.15-1.js | 7 ++----- test/built-ins/Date/now/15.9.4.4-0-3.js | 8 ++------ .../Date/prototype/toISOString/15.9.5.43-0-11.js | 6 +----- .../Date/prototype/toISOString/15.9.5.43-0-12.js | 6 +----- .../Date/prototype/toISOString/15.9.5.43-0-4.js | 6 +----- .../Date/prototype/toISOString/15.9.5.43-0-5.js | 7 ++----- test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js | 9 ++------- test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js | 8 +------- 8 files changed, 12 insertions(+), 45 deletions(-) diff --git a/test/built-ins/Date/15.9.1.15-1.js b/test/built-ins/Date/15.9.1.15-1.js index f712bffd6d..eef35a051e 100644 --- a/test/built-ins/Date/15.9.1.15-1.js +++ b/test/built-ins/Date/15.9.1.15-1.js @@ -7,15 +7,12 @@ description: > Date Time String Format - specified default values will be set for all optional fields(MM, DD, mm, ss and time zone) when they are absent -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; var expectedDateTimeStr = new Date(1970, 0, 1, 0, 0, 0, 0).toISOString(); var dateObj = new Date("1970"); var dateStr = dateObj.toISOString(); result = dateStr === expectedDateTimeStr; - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Date/now/15.9.4.4-0-3.js b/test/built-ins/Date/now/15.9.4.4-0-3.js index ff1749c444..324d8d7093 100644 --- a/test/built-ins/Date/now/15.9.4.4-0-3.js +++ b/test/built-ins/Date/now/15.9.4.4-0-3.js @@ -4,12 +4,8 @@ /*--- es5id: 15.9.4.4-0-3 description: Date.now must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { - var fun = Date.now; - return (typeof (fun) === "function"); - } -runTestCase(testcase); + +assert.sameValue(typeof (fun), "function", 'typeof (fun)'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js index 6cc15fcd58..13a93f295d 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js @@ -7,16 +7,12 @@ description: > Date.prototype.toISOString - RangeError is not 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; date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, -1); dateStr = date.toISOString(); - return dateStr[dateStr.length - 1] === "Z"; - } -runTestCase(testcase); +assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js index 594b5c2301..5d026d6ca6 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js @@ -7,16 +7,12 @@ description: > Date.prototype.toISOString - RangeError is not thrown when value of date is Date(1970, 0, 100000001, 0, 0, 0, 0), the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var timeZoneMinutes = new Date().getTimezoneOffset() * (-1); var date, dateStr; date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, 0); dateStr = date.toISOString(); - return dateStr[dateStr.length - 1] === "Z"; - } -runTestCase(testcase); +assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js index 947e5d480f..2b4e4c026a 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js @@ -6,13 +6,9 @@ es5id: 15.9.5.43-0-4 description: > Date.prototype.toISOString - format of returned string is 'YYYY-MM-DDTHH:mm:ss.sssZ', the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var date = new Date(1999, 9, 10, 10, 10, 10, 10); var localDate = new Date(date.getTime() - date.getTimezoneOffset() * 60000); - return localDate.toISOString() === "1999-10-10T10:10:10.010Z"; - } -runTestCase(testcase); +assert.sameValue(localDate.toISOString(), "1999-10-10T10:10:10.010Z", 'localDate.toISOString()'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js index 0a73b528c3..3df6f20c9e 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js @@ -6,11 +6,8 @@ es5id: 15.9.5.43-0-5 description: > Date.prototype.toISOString - The returned string is the UTC time zone(0) -includes: [runTestCase.js] ---*/ -function testcase() { var dateStr = (new Date()).toISOString(); - return dateStr[dateStr.length - 1] === "Z"; - } -runTestCase(testcase); + +assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]'); diff --git a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js index 4600c686e8..1796e5c426 100644 --- a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js +++ b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.9.5.44-0-1 description: Date.prototype.toJSON must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Date.prototype.toJSON; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js index 7fa161c1c9..aa8a77fe71 100644 --- a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js +++ b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.9.5.44-0-2 description: Date.prototype.toJSON must exist as a function taking 1 parameter -includes: [runTestCase.js] ---*/ -function testcase() { - if (Date.prototype.toJSON.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Date.prototype.toJSON.length, 1, 'Date.prototype.toJSON.length'); 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 5/9] 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])'); From 33a7e03a768bd2480fda976700eae804310dddaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:26:07 +0200 Subject: [PATCH 6/9] Replace runTestCase with assert helpers [test/built-ins/Math] --- test/built-ins/Math/clz32/Math.clz32.js | 8 +------- test/built-ins/Math/clz32/Math.clz32_1.js | 8 +------- test/built-ins/Math/clz32/Math.clz32_2.js | 8 +------- test/built-ins/Math/fround/Math.fround_Infinity.js | 8 +------- test/built-ins/Math/fround/Math.fround_NaN.js | 8 +------- test/built-ins/Math/fround/Math.fround_Zero.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_Infinity.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_InfinityNaN.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_NaN.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_NegInfinity.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_NoArgs.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_Success.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_Success_2.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_Zero_2.js | 8 +------- test/built-ins/Math/hypot/Math.hypot_lengthProp.js | 8 +------- test/built-ins/Math/trunc/Math.trunc_Infinity.js | 8 +------- test/built-ins/Math/trunc/Math.trunc_NaN.js | 8 +------- test/built-ins/Math/trunc/Math.trunc_NegDecimal.js | 10 ++-------- test/built-ins/Math/trunc/Math.trunc_PosDecimal.js | 8 +------- test/built-ins/Math/trunc/Math.trunc_Success.js | 8 +------- test/built-ins/Math/trunc/Math.trunc_Zero.js | 8 +------- 21 files changed, 22 insertions(+), 148 deletions(-) diff --git a/test/built-ins/Math/clz32/Math.clz32.js b/test/built-ins/Math/clz32/Math.clz32.js index 0be6a84e64..f30b3a995b 100644 --- a/test/built-ins/Math/clz32/Math.clz32.js +++ b/test/built-ins/Math/clz32/Math.clz32.js @@ -5,12 +5,6 @@ es6id: 20.2.2.11 author: Ryan Lewis description: Math.clz32 should return 32 if passed 0. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.clz32(0) === 32) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.clz32(0), 32, 'Math.clz32(0)'); diff --git a/test/built-ins/Math/clz32/Math.clz32_1.js b/test/built-ins/Math/clz32/Math.clz32_1.js index 77a06c3bd9..3b571a737d 100644 --- a/test/built-ins/Math/clz32/Math.clz32_1.js +++ b/test/built-ins/Math/clz32/Math.clz32_1.js @@ -5,12 +5,6 @@ es6id: 20.2.2.11 author: Ryan Lewis description: Math.clz32 should return 31 if passed 1. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.clz32(1) === 31) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.clz32(1), 31, 'Math.clz32(1)'); diff --git a/test/built-ins/Math/clz32/Math.clz32_2.js b/test/built-ins/Math/clz32/Math.clz32_2.js index 29859bc2f3..65c65deac3 100644 --- a/test/built-ins/Math/clz32/Math.clz32_2.js +++ b/test/built-ins/Math/clz32/Math.clz32_2.js @@ -5,12 +5,6 @@ es6id: 20.2.2.11 author: Ryan Lewis description: Math.clz32 should return 0 if passed 2147483648 -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.clz32(2147483648) === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.clz32(2147483648), 0, 'Math.clz32(2147483648)'); diff --git a/test/built-ins/Math/fround/Math.fround_Infinity.js b/test/built-ins/Math/fround/Math.fround_Infinity.js index b4f513796a..b59e40873b 100644 --- a/test/built-ins/Math/fround/Math.fround_Infinity.js +++ b/test/built-ins/Math/fround/Math.fround_Infinity.js @@ -5,12 +5,6 @@ es6id: 20.2.2.17 author: Ryan Lewis description: Math.fround should return Infinity if called with Infinity. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.fround(Infinity) === Infinity) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.fround(Infinity), Infinity, 'Math.fround(Infinity)'); diff --git a/test/built-ins/Math/fround/Math.fround_NaN.js b/test/built-ins/Math/fround/Math.fround_NaN.js index b266b1f2e7..6023333373 100644 --- a/test/built-ins/Math/fround/Math.fround_NaN.js +++ b/test/built-ins/Math/fround/Math.fround_NaN.js @@ -5,12 +5,6 @@ es6id: 20.2.2.17 author: Ryan Lewis description: Math.fround should return NaN if called with NaN. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isNaN(Math.fround(NaN))) { - return true; - } - } -runTestCase(testcase); +assert(Number.isNaN(Math.fround(NaN)), 'Number.isNaN(Math.fround(NaN)) !== true'); diff --git a/test/built-ins/Math/fround/Math.fround_Zero.js b/test/built-ins/Math/fround/Math.fround_Zero.js index a9d358017e..b6864fe421 100644 --- a/test/built-ins/Math/fround/Math.fround_Zero.js +++ b/test/built-ins/Math/fround/Math.fround_Zero.js @@ -5,12 +5,6 @@ es6id: 20.2.2.17 author: Ryan Lewis description: Math.fround should return 0 if called with 0. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.fround(0) === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.fround(0), 0, 'Math.fround(0)'); diff --git a/test/built-ins/Math/hypot/Math.hypot_Infinity.js b/test/built-ins/Math/hypot/Math.hypot_Infinity.js index 4457cdd821..f20b98fe7e 100644 --- a/test/built-ins/Math/hypot/Math.hypot_Infinity.js +++ b/test/built-ins/Math/hypot/Math.hypot_Infinity.js @@ -7,12 +7,6 @@ author: Ryan Lewis description: > Math.hypot should return Infinity if called with any argument that is Infinity. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot(3, Infinity) === Infinity) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot(3, Infinity), Infinity, 'Math.hypot(3, Infinity)'); diff --git a/test/built-ins/Math/hypot/Math.hypot_InfinityNaN.js b/test/built-ins/Math/hypot/Math.hypot_InfinityNaN.js index 798186153b..f87c222f74 100644 --- a/test/built-ins/Math/hypot/Math.hypot_InfinityNaN.js +++ b/test/built-ins/Math/hypot/Math.hypot_InfinityNaN.js @@ -7,12 +7,6 @@ author: Ryan Lewis description: > Math.hypot should return Infinity if called with any argument that is Infinity. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot(NaN, Infinity) === Infinity) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot(NaN, Infinity), Infinity, 'Math.hypot(NaN, Infinity)'); diff --git a/test/built-ins/Math/hypot/Math.hypot_NaN.js b/test/built-ins/Math/hypot/Math.hypot_NaN.js index f69404e3d2..0f29e79ae7 100644 --- a/test/built-ins/Math/hypot/Math.hypot_NaN.js +++ b/test/built-ins/Math/hypot/Math.hypot_NaN.js @@ -7,12 +7,6 @@ author: Ryan Lewis description: > Math.hypot should return NaN if called with any argument that is NaN. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isNaN(Math.hypot(NaN, 3))) { - return true; - } - } -runTestCase(testcase); +assert(Number.isNaN(Math.hypot(NaN, 3)), 'Number.isNaN(Math.hypot(NaN, 3)) !== true'); diff --git a/test/built-ins/Math/hypot/Math.hypot_NegInfinity.js b/test/built-ins/Math/hypot/Math.hypot_NegInfinity.js index 14c3fb534b..c28083db02 100644 --- a/test/built-ins/Math/hypot/Math.hypot_NegInfinity.js +++ b/test/built-ins/Math/hypot/Math.hypot_NegInfinity.js @@ -7,12 +7,6 @@ author: Ryan Lewis description: > Math.hypot should return Infinity if called with any argument that is -Infinity. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot(3, -Infinity) === Infinity) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot(3, -Infinity), Infinity, 'Math.hypot(3, -Infinity)'); diff --git a/test/built-ins/Math/hypot/Math.hypot_NoArgs.js b/test/built-ins/Math/hypot/Math.hypot_NoArgs.js index 75a4b1ca5e..164a9aa38f 100644 --- a/test/built-ins/Math/hypot/Math.hypot_NoArgs.js +++ b/test/built-ins/Math/hypot/Math.hypot_NoArgs.js @@ -5,12 +5,6 @@ es6id: 20.2.2.18 author: Ryan Lewis description: Math.hypot should return 0 if called with no arguments. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot() === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot(), 0, 'Math.hypot()'); diff --git a/test/built-ins/Math/hypot/Math.hypot_Success.js b/test/built-ins/Math/hypot/Math.hypot_Success.js index e341b053b7..02d7fc7e38 100644 --- a/test/built-ins/Math/hypot/Math.hypot_Success.js +++ b/test/built-ins/Math/hypot/Math.hypot_Success.js @@ -5,12 +5,6 @@ es6id: 20.2.2.18 author: Ryan Lewis description: Math.hypot should return 4 if called with 3 and 2.6457513110645907. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot(3,2.6457513110645907) === 4) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot(3,2.6457513110645907), 4, 'Math.hypot(3,2.6457513110645907)'); diff --git a/test/built-ins/Math/hypot/Math.hypot_Success_2.js b/test/built-ins/Math/hypot/Math.hypot_Success_2.js index d7354b5d45..4106a0a777 100644 --- a/test/built-ins/Math/hypot/Math.hypot_Success_2.js +++ b/test/built-ins/Math/hypot/Math.hypot_Success_2.js @@ -5,12 +5,6 @@ es6id: 20.2.2.18 author: Ryan Lewis description: Math.hypot should return 5 if called with 3 and 4. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot(3,4) === 5) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot(3,4), 5, 'Math.hypot(3,4)'); diff --git a/test/built-ins/Math/hypot/Math.hypot_Zero_2.js b/test/built-ins/Math/hypot/Math.hypot_Zero_2.js index 75a5d1c832..0a33737cbe 100644 --- a/test/built-ins/Math/hypot/Math.hypot_Zero_2.js +++ b/test/built-ins/Math/hypot/Math.hypot_Zero_2.js @@ -5,12 +5,6 @@ es6id: 20.2.2.18 author: Ryan Lewis description: Math.hypot should return 0 if called with all arguments being 0. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot(0, 0) === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot(0, 0), 0, 'Math.hypot(0, 0)'); diff --git a/test/built-ins/Math/hypot/Math.hypot_lengthProp.js b/test/built-ins/Math/hypot/Math.hypot_lengthProp.js index d213617a22..1bafa47549 100644 --- a/test/built-ins/Math/hypot/Math.hypot_lengthProp.js +++ b/test/built-ins/Math/hypot/Math.hypot_lengthProp.js @@ -5,12 +5,6 @@ es6id: 20.2.2.18 author: Ryan Lewis description: Math.hypot.length should return 2. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.hypot.length === 2) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.hypot.length, 2, 'Math.hypot.length'); diff --git a/test/built-ins/Math/trunc/Math.trunc_Infinity.js b/test/built-ins/Math/trunc/Math.trunc_Infinity.js index 6d5f8fe918..6a9abb4272 100644 --- a/test/built-ins/Math/trunc/Math.trunc_Infinity.js +++ b/test/built-ins/Math/trunc/Math.trunc_Infinity.js @@ -5,12 +5,6 @@ es6id: 20.2.2.35 author: Ryan Lewis description: Math.trunc should return Infinity when called with Infinity. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.trunc(.9) === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.trunc(.9), 0, 'Math.trunc(.9)'); diff --git a/test/built-ins/Math/trunc/Math.trunc_NaN.js b/test/built-ins/Math/trunc/Math.trunc_NaN.js index e7793128be..485b532177 100644 --- a/test/built-ins/Math/trunc/Math.trunc_NaN.js +++ b/test/built-ins/Math/trunc/Math.trunc_NaN.js @@ -5,12 +5,6 @@ es6id: 20.2.2.35 author: Ryan Lewis description: Math.trunc should return NaN when called with NaN. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isNaN(Math.trunc(NaN))) { - return true; - } - } -runTestCase(testcase); +assert(Number.isNaN(Math.trunc(NaN)), 'Number.isNaN(Math.trunc(NaN)) !== true'); diff --git a/test/built-ins/Math/trunc/Math.trunc_NegDecimal.js b/test/built-ins/Math/trunc/Math.trunc_NegDecimal.js index 59b5e9ee15..3c543e3293 100644 --- a/test/built-ins/Math/trunc/Math.trunc_NegDecimal.js +++ b/test/built-ins/Math/trunc/Math.trunc_NegDecimal.js @@ -4,13 +4,7 @@ /*--- es6id: 20.2.2.35 author: Ryan Lewis -description: Math.trunc should return 0 if called with a value between 0 and -1. -includes: [runTestCase.js] +description: Math.trunc should return -0 if called with a value between 0 and -1. ---*/ -function testcase() { - if(Math.trunc(-.9) === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.trunc(-.9), -0, 'Math.trunc(-.9)'); diff --git a/test/built-ins/Math/trunc/Math.trunc_PosDecimal.js b/test/built-ins/Math/trunc/Math.trunc_PosDecimal.js index 537bdd5af7..5efecccccd 100644 --- a/test/built-ins/Math/trunc/Math.trunc_PosDecimal.js +++ b/test/built-ins/Math/trunc/Math.trunc_PosDecimal.js @@ -5,12 +5,6 @@ es6id: 20.2.2.35 author: Ryan Lewis description: Math.trunc should return 0 if called with a value between 0 and 1. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.trunc(.9) === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.trunc(.9), 0, 'Math.trunc(.9)'); diff --git a/test/built-ins/Math/trunc/Math.trunc_Success.js b/test/built-ins/Math/trunc/Math.trunc_Success.js index ba75251755..f035290e4c 100644 --- a/test/built-ins/Math/trunc/Math.trunc_Success.js +++ b/test/built-ins/Math/trunc/Math.trunc_Success.js @@ -5,12 +5,6 @@ es6id: 20.2.2.35 author: Ryan Lewis description: Math.trunc should return 4578 if called with 4578.584949 -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.trunc(4578.584949) === 4578) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.trunc(4578.584949), 4578, 'Math.trunc(4578.584949)'); diff --git a/test/built-ins/Math/trunc/Math.trunc_Zero.js b/test/built-ins/Math/trunc/Math.trunc_Zero.js index 847046863b..3101668f44 100644 --- a/test/built-ins/Math/trunc/Math.trunc_Zero.js +++ b/test/built-ins/Math/trunc/Math.trunc_Zero.js @@ -5,12 +5,6 @@ es6id: 20.2.2.35 author: Ryan Lewis description: Math.trunc should return 0 when called with 0. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Math.trunc(0) === 0) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Math.trunc(0), 0, 'Math.trunc(0)'); From 6cd7b9e275fb0c48d3e904cb89f3c4c85459ceee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:26:38 +0200 Subject: [PATCH 7/9] Replace runTestCase with assert helpers [test/built-ins/Number] --- test/built-ins/Number/15.7.3-1.js | 8 +------- test/built-ins/Number/15.7.3-2.js | 9 ++------- test/built-ins/Number/15.7.4-1.js | 7 ++----- .../Number/isInteger/Number.isInteger_Double.js | 8 +------- .../Number/isInteger/Number.isInteger_Infinity.js | 8 +------- .../Number/isInteger/Number.isInteger_NaN.js | 8 +------- .../Number/isInteger/Number.isInteger_NonNumber.js | 8 +------- .../Number/isInteger/Number.isInteger_String.js | 8 +------- .../Number/isInteger/Number.isInteger_Success.js | 8 +------- test/built-ins/Number/prototype/15.7.3.1-1.js | 13 ++++--------- test/built-ins/Number/prototype/15.7.3.1-2.js | 7 ++----- 11 files changed, 17 insertions(+), 75 deletions(-) diff --git a/test/built-ins/Number/15.7.3-1.js b/test/built-ins/Number/15.7.3-1.js index a1c115b36a..9f302fe5d9 100644 --- a/test/built-ins/Number/15.7.3-1.js +++ b/test/built-ins/Number/15.7.3-1.js @@ -4,12 +4,6 @@ /*--- es5id: 15.7.3-1 description: Number constructor - [[Prototype]] is the Function prototype object -includes: [runTestCase.js] ---*/ -function testcase() { - if (Function.prototype.isPrototypeOf(Number) === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Function.prototype.isPrototypeOf(Number), true, 'Function.prototype.isPrototypeOf(Number)'); diff --git a/test/built-ins/Number/15.7.3-2.js b/test/built-ins/Number/15.7.3-2.js index 032263e8bf..e4bba35d8c 100644 --- a/test/built-ins/Number/15.7.3-2.js +++ b/test/built-ins/Number/15.7.3-2.js @@ -6,13 +6,8 @@ es5id: 15.7.3-2 description: > Number constructor - [[Prototype]] is the Function prototype object (using getPrototypeOf) -includes: [runTestCase.js] ---*/ -function testcase() { var p = Object.getPrototypeOf(Number); - if (p === Function.prototype) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(p, Function.prototype, 'p'); diff --git a/test/built-ins/Number/15.7.4-1.js b/test/built-ins/Number/15.7.4-1.js index b289681ce8..f9e919bad0 100644 --- a/test/built-ins/Number/15.7.4-1.js +++ b/test/built-ins/Number/15.7.4-1.js @@ -4,12 +4,9 @@ /*--- es5id: 15.7.4-1 description: "Number prototype object: its [[Class]] must be 'Object'" -includes: [runTestCase.js] ---*/ -function testcase() { var numProto = Object.getPrototypeOf(new Number(42)); var s = Object.prototype.toString.call(numProto ); - return (s === '[object Object]') ; - } -runTestCase(testcase); + +assert.sameValue(s, '[object Object]', 's'); diff --git a/test/built-ins/Number/isInteger/Number.isInteger_Double.js b/test/built-ins/Number/isInteger/Number.isInteger_Double.js index cf8d0d3c56..7cf69d73bf 100644 --- a/test/built-ins/Number/isInteger/Number.isInteger_Double.js +++ b/test/built-ins/Number/isInteger/Number.isInteger_Double.js @@ -5,12 +5,6 @@ es6id: 20.1.2.3 author: Ryan Lewis description: Number.isInteger should return false if called with a double. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isInteger(6.75) === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Number.isInteger(6.75), false, 'Number.isInteger(6.75)'); diff --git a/test/built-ins/Number/isInteger/Number.isInteger_Infinity.js b/test/built-ins/Number/isInteger/Number.isInteger_Infinity.js index 7a51ded2ff..4eb3282371 100644 --- a/test/built-ins/Number/isInteger/Number.isInteger_Infinity.js +++ b/test/built-ins/Number/isInteger/Number.isInteger_Infinity.js @@ -5,12 +5,6 @@ es6id: 20.1.2.3 author: Ryan Lewis description: Number.isInteger should return false if called with Infinity. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isInteger(Infinity) === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Number.isInteger(Infinity), false, 'Number.isInteger(Infinity)'); diff --git a/test/built-ins/Number/isInteger/Number.isInteger_NaN.js b/test/built-ins/Number/isInteger/Number.isInteger_NaN.js index fbfa2bdb4c..e915ecfc85 100644 --- a/test/built-ins/Number/isInteger/Number.isInteger_NaN.js +++ b/test/built-ins/Number/isInteger/Number.isInteger_NaN.js @@ -5,12 +5,6 @@ es6id: 20.1.2.3 author: Ryan Lewis description: Number.isInteger should return false if called with NaN. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isInteger(NaN) === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Number.isInteger(NaN), false, 'Number.isInteger(NaN)'); diff --git a/test/built-ins/Number/isInteger/Number.isInteger_NonNumber.js b/test/built-ins/Number/isInteger/Number.isInteger_NonNumber.js index a40ed2561f..382c52a4a2 100644 --- a/test/built-ins/Number/isInteger/Number.isInteger_NonNumber.js +++ b/test/built-ins/Number/isInteger/Number.isInteger_NonNumber.js @@ -7,12 +7,6 @@ author: Ryan Lewis description: > Number.isInteger should return false if called with a string (non-Number) -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isInteger('2') === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Number.isInteger('2'), false, 'Number.isInteger("2")'); diff --git a/test/built-ins/Number/isInteger/Number.isInteger_String.js b/test/built-ins/Number/isInteger/Number.isInteger_String.js index 7ac8ca8e45..71ddf854de 100644 --- a/test/built-ins/Number/isInteger/Number.isInteger_String.js +++ b/test/built-ins/Number/isInteger/Number.isInteger_String.js @@ -7,12 +7,6 @@ author: Ryan Lewis description: > Number.isInteger should return false if called with a string (non-Number) -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isInteger('word') === false) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Number.isInteger('word'), false, 'Number.isInteger("word")'); diff --git a/test/built-ins/Number/isInteger/Number.isInteger_Success.js b/test/built-ins/Number/isInteger/Number.isInteger_Success.js index ea44f4cbca..d80454ef3d 100644 --- a/test/built-ins/Number/isInteger/Number.isInteger_Success.js +++ b/test/built-ins/Number/isInteger/Number.isInteger_Success.js @@ -5,12 +5,6 @@ es6id: 20.1.2.3 author: Ryan Lewis description: Number.isInteger should return true if called with an integer. -includes: [runTestCase.js] ---*/ -function testcase() { - if(Number.isInteger(478) === true) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Number.isInteger(478), true, 'Number.isInteger(478)'); diff --git a/test/built-ins/Number/prototype/15.7.3.1-1.js b/test/built-ins/Number/prototype/15.7.3.1-1.js index a4ae9bf7dc..cd834c8615 100644 --- a/test/built-ins/Number/prototype/15.7.3.1-1.js +++ b/test/built-ins/Number/prototype/15.7.3.1-1.js @@ -6,16 +6,11 @@ es5id: 15.7.3.1-1 description: > Number.prototype is a data property with default attribute values (false) -includes: [runTestCase.js] ---*/ -function testcase() { var d = Object.getOwnPropertyDescriptor(Number, 'prototype'); - if (d.writable === false && - d.enumerable === false && - d.configurable === false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(d.writable, false, 'd.writable'); +assert.sameValue(d.enumerable, false, 'd.enumerable'); +assert.sameValue(d.configurable, false, 'd.configurable'); diff --git a/test/built-ins/Number/prototype/15.7.3.1-2.js b/test/built-ins/Number/prototype/15.7.3.1-2.js index 836dcdf1d3..dbb49123f6 100644 --- a/test/built-ins/Number/prototype/15.7.3.1-2.js +++ b/test/built-ins/Number/prototype/15.7.3.1-2.js @@ -4,11 +4,8 @@ /*--- es5id: 15.7.3.1-2 description: Number.prototype, initial value is the Number prototype object -includes: [runTestCase.js] ---*/ -function testcase() { // assume that Number.prototype has not been modified. - return Object.getPrototypeOf(new Number(42))===Number.prototype; - } -runTestCase(testcase); + +assert.sameValue(Object.getPrototypeOf(new Number(42)), Number.prototype, 'Object.getPrototypeOf(new Number(42))'); From 50c29deb2942e96ab8c01eaf5c36ce783c6bfb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:26:59 +0200 Subject: [PATCH 8/9] Replace runTestCase with assert helpers [test/built-ins/RegExp] --- test/built-ins/RegExp/prototype/15.10.6.js | 7 ++----- .../RegExp/prototype/exec/15.10.6.2-9-e-1.js | 7 ++----- .../RegExp/prototype/global/15.10.7.2-2.js | 15 +++++---------- .../RegExp/prototype/ignoreCase/15.10.7.3-2.js | 15 +++++---------- .../RegExp/prototype/lastIndex/15.10.7.5-2.js | 7 ++----- .../RegExp/prototype/multiline/15.10.7.4-2.js | 15 +++++---------- .../RegExp/prototype/source/15.10.7.1-2.js | 15 +++++---------- 7 files changed, 26 insertions(+), 55 deletions(-) diff --git a/test/built-ins/RegExp/prototype/15.10.6.js b/test/built-ins/RegExp/prototype/15.10.6.js index 8fa049a919..a1d12241f2 100644 --- a/test/built-ins/RegExp/prototype/15.10.6.js +++ b/test/built-ins/RegExp/prototype/15.10.6.js @@ -4,11 +4,8 @@ /*--- es5id: 15.10.6 description: RegExp.prototype is itself a not RegExp -includes: [runTestCase.js] ---*/ -function testcase() { var s = Object.prototype.toString.call(RegExp.prototype); - return s === '[object Object]'; - } -runTestCase(testcase); + +assert.sameValue(s, '[object Object]', 's'); diff --git a/test/built-ins/RegExp/prototype/exec/15.10.6.2-9-e-1.js b/test/built-ins/RegExp/prototype/exec/15.10.6.2-9-e-1.js index 4d3e152317..ab93d95a8a 100644 --- a/test/built-ins/RegExp/prototype/exec/15.10.6.2-9-e-1.js +++ b/test/built-ins/RegExp/prototype/exec/15.10.6.2-9-e-1.js @@ -6,14 +6,11 @@ es5id: 15.10.6.2-9-e-1 description: > RegExp.prototype.exec - the removed step 9.e won't affected current algorithm -includes: [runTestCase.js] ---*/ -function testcase() { var str = "Hello World!"; var regObj = new RegExp("World"); var result = false; result = regObj.exec(str).toString() === "World"; - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/RegExp/prototype/global/15.10.7.2-2.js b/test/built-ins/RegExp/prototype/global/15.10.7.2-2.js index a30fa4da8e..bc00e211fd 100644 --- a/test/built-ins/RegExp/prototype/global/15.10.7.2-2.js +++ b/test/built-ins/RegExp/prototype/global/15.10.7.2-2.js @@ -6,17 +6,12 @@ es5id: 15.10.7.2-2 description: > RegExp.prototype.global is an accessor property whose set accessor function is undefined -includes: [runTestCase.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global'); - if (typeof desc.get === 'function' && - desc.set === undefined && - desc.enumerable === false && - desc.configurable === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof desc.get, 'function', 'typeof desc.get'); +assert.sameValue(desc.set, undefined, 'desc.set'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js b/test/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js index abf7079533..60fecfef54 100644 --- a/test/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js +++ b/test/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js @@ -6,17 +6,12 @@ es5id: 15.10.7.3-2 description: > RegExp.prototype.ignoreCase is an accessor property whose set accessor function is undefined -includes: [runTestCase.js] ---*/ -function testcase() { var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase'); - if (typeof d.get === 'function' && - d.set === undefined && - d.enumerable === false && - d.configurable === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof d.get, 'function', 'typeof d.get'); +assert.sameValue(d.set, undefined, 'd.set'); +assert.sameValue(d.enumerable, false, 'd.enumerable'); +assert.sameValue(d.configurable, true, 'd.configurable'); diff --git a/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-2.js b/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-2.js index a96fc0ebff..a9a7e73c84 100644 --- a/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-2.js +++ b/test/built-ins/RegExp/prototype/lastIndex/15.10.7.5-2.js @@ -4,11 +4,8 @@ /*--- es5id: 15.10.7.5-2 description: RegExp.prototype.lastIndex is not present -includes: [runTestCase.js] ---*/ -function testcase() { var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'lastIndex'); - return d === undefined; - } -runTestCase(testcase); + +assert.sameValue(d, undefined, 'd'); diff --git a/test/built-ins/RegExp/prototype/multiline/15.10.7.4-2.js b/test/built-ins/RegExp/prototype/multiline/15.10.7.4-2.js index 69e6a65c0c..3b0ca4ddea 100644 --- a/test/built-ins/RegExp/prototype/multiline/15.10.7.4-2.js +++ b/test/built-ins/RegExp/prototype/multiline/15.10.7.4-2.js @@ -6,17 +6,12 @@ es5id: 15.10.7.4-2 description: > RegExp.prototype.multiline is an accessor property whose set accessor function is undefined -includes: [runTestCase.js] ---*/ -function testcase() { var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'multiline'); - if (typeof d.get === 'function' && - d.set === undefined && - d.enumerable === false && - d.configurable === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof d.get, 'function', 'typeof d.get'); +assert.sameValue(d.set, undefined, 'd.set'); +assert.sameValue(d.enumerable, false, 'd.enumerable'); +assert.sameValue(d.configurable, true, 'd.configurable'); diff --git a/test/built-ins/RegExp/prototype/source/15.10.7.1-2.js b/test/built-ins/RegExp/prototype/source/15.10.7.1-2.js index eebeb495d4..2af0b47a2a 100644 --- a/test/built-ins/RegExp/prototype/source/15.10.7.1-2.js +++ b/test/built-ins/RegExp/prototype/source/15.10.7.1-2.js @@ -6,17 +6,12 @@ es5id: 15.10.7.1-2 description: > RegExp.prototype.source is an accessor property whose set accessor function is undefined -includes: [runTestCase.js] ---*/ -function testcase() { var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source'); - if (typeof d.get === 'function' && - d.set === undefined && - d.enumerable === false && - d.configurable === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof d.get, 'function', 'typeof d.get'); +assert.sameValue(d.set, undefined, 'd.set'); +assert.sameValue(d.enumerable, false, 'd.enumerable'); +assert.sameValue(d.configurable, true, 'd.configurable'); From 7d6d983ff9ae01e8979bc5a3fd7a0d8214afa5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:27:21 +0200 Subject: [PATCH 9/9] Replace runTestCase with assert helpers [test/built-ins/] --- test/built-ins/Infinity/15.1.1.2-0.js | 16 +++++----------- test/built-ins/NaN/15.1.1.1-0.js | 16 +++++----------- test/built-ins/undefined/15.1.1.3-0.js | 16 +++++----------- test/built-ins/undefined/15.1.1.3-3.js | 6 +----- 4 files changed, 16 insertions(+), 38 deletions(-) diff --git a/test/built-ins/Infinity/15.1.1.2-0.js b/test/built-ins/Infinity/15.1.1.2-0.js index 3f84b0e9c9..40ace7cd79 100644 --- a/test/built-ins/Infinity/15.1.1.2-0.js +++ b/test/built-ins/Infinity/15.1.1.2-0.js @@ -6,17 +6,11 @@ es5id: 15.1.1.2-0 description: > Global.Infinity is a data property with default attribute values (false) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'Infinity'); - if (desc.writable === false && - desc.enumerable === false && - desc.configurable === false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, false, 'desc.configurable'); diff --git a/test/built-ins/NaN/15.1.1.1-0.js b/test/built-ins/NaN/15.1.1.1-0.js index ef6b2cba7e..48d3e9dd95 100644 --- a/test/built-ins/NaN/15.1.1.1-0.js +++ b/test/built-ins/NaN/15.1.1.1-0.js @@ -4,17 +4,11 @@ /*--- es5id: 15.1.1.1-0 description: Global.NaN is a data property with default attribute values (false) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'NaN'); - if (desc.writable === false && - desc.enumerable === false && - desc.configurable === false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, false, 'desc.configurable'); diff --git a/test/built-ins/undefined/15.1.1.3-0.js b/test/built-ins/undefined/15.1.1.3-0.js index 18e0e1501b..ff51a3ab1d 100644 --- a/test/built-ins/undefined/15.1.1.3-0.js +++ b/test/built-ins/undefined/15.1.1.3-0.js @@ -6,17 +6,11 @@ es5id: 15.1.1.3-0 description: > Global.undefined is a data property with default attribute values (false) -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var desc = Object.getOwnPropertyDescriptor(fnGlobalObject(), 'undefined'); - if (desc.writable === false && - desc.enumerable === false && - desc.configurable === false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, false, 'desc.configurable'); diff --git a/test/built-ins/undefined/15.1.1.3-3.js b/test/built-ins/undefined/15.1.1.3-3.js index 10076f264f..5d79d5c52f 100644 --- a/test/built-ins/undefined/15.1.1.3-3.js +++ b/test/built-ins/undefined/15.1.1.3-3.js @@ -7,12 +7,8 @@ description: > undefined is not writable, simple assignment should return the rval value (11.13.1-6) flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase(){ var newProperty = undefined = 42; - return (newProperty === 42); -} -runTestCase(testcase); +assert.sameValue(newProperty, 42, 'newProperty');