diff options
author | André Bargull <andre.bargull@gmail.com> | 2015-08-06 18:33:10 +0200 |
---|---|---|
committer | André Bargull <andre.bargull@gmail.com> | 2015-08-06 18:33:10 +0200 |
commit | 3c3e0a6adb097b752f2f9cb44ae4e50211f5ca88 (patch) | |
tree | 2e7c7dc204b6ebb7b54faa25156896855eeb55f2 /test/language | |
parent | 713df280e5f6785b074ced74195b65f512de3e7d (diff) | |
download | qtdeclarative-testsuites-3c3e0a6adb097b752f2f9cb44ae4e50211f5ca88.tar.gz |
Replace runTestCase with assert helpers [test/language/statements/]
Diffstat (limited to 'test/language')
-rw-r--r-- | test/language/statements/break/12.8-1.js | 7 | ||||
-rw-r--r-- | test/language/statements/continue/12.7-1.js | 7 | ||||
-rw-r--r-- | test/language/statements/for-in/12.6.4-1.js | 9 | ||||
-rw-r--r-- | test/language/statements/for-in/12.6.4-2.js | 7 | ||||
-rw-r--r-- | test/language/statements/function/13.0-12-s.js | 6 | ||||
-rw-r--r-- | test/language/statements/function/13.1-2-2.js | 6 | ||||
-rw-r--r-- | test/language/statements/function/13.2-1-s.js | 7 | ||||
-rw-r--r-- | test/language/statements/return/12.9-1.js | 7 | ||||
-rw-r--r-- | test/language/statements/variable/12.2.1-10-s.js | 5 | ||||
-rw-r--r-- | test/language/statements/variable/12.2.1-5-s.js | 5 | ||||
-rw-r--r-- | test/language/statements/variable/12.2.1-6-s.js | 5 | ||||
-rw-r--r-- | test/language/statements/with/12.10-0-1.js | 7 | ||||
-rw-r--r-- | test/language/statements/with/12.10-0-3.js | 7 | ||||
-rw-r--r-- | test/language/statements/with/12.10-0-8.js | 6 |
14 files changed, 18 insertions, 73 deletions
diff --git a/test/language/statements/break/12.8-1.js b/test/language/statements/break/12.8-1.js index eb32c31af..82137439e 100644 --- a/test/language/statements/break/12.8-1.js +++ b/test/language/statements/break/12.8-1.js @@ -6,10 +6,8 @@ es5id: 12.8-1 description: > The break Statement - a break statement without an identifier may have a LineTerminator before the semi-colon -includes: [runTestCase.js] ---*/ -function testcase() { var sum = 0; for (var i = 1; i <= 10; i++) { if (i === 6) { @@ -18,6 +16,5 @@ function testcase() { } sum += i; } - return sum === 15; - } -runTestCase(testcase); + +assert.sameValue(sum, 15, 'sum'); diff --git a/test/language/statements/continue/12.7-1.js b/test/language/statements/continue/12.7-1.js index d9092bc96..b97021377 100644 --- a/test/language/statements/continue/12.7-1.js +++ b/test/language/statements/continue/12.7-1.js @@ -6,16 +6,13 @@ es5id: 12.7-1 description: > The continue Statement - a continue statement without an identifier may have a LineTerminator before the semi-colon -includes: [runTestCase.js] ---*/ -function testcase() { var sum = 0; for (var i = 1; i <= 10; i++) { continue ; sum += i; } - return sum === 0; - } -runTestCase(testcase); + +assert.sameValue(sum, 0, 'sum'); diff --git a/test/language/statements/for-in/12.6.4-1.js b/test/language/statements/for-in/12.6.4-1.js index 71a7ad5cc..92284ee3c 100644 --- a/test/language/statements/for-in/12.6.4-1.js +++ b/test/language/statements/for-in/12.6.4-1.js @@ -6,10 +6,8 @@ es5id: 12.6.4-1 description: > The for-in Statement - a property name must not be visited more than once in any enumeration. -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop1: "abc", prop2: "bbc", prop3: "cnn" }; var countProp1 = 0; @@ -29,6 +27,7 @@ function testcase() { } } } - return countProp1 === 1 && countProp2 === 1 && countProp3 === 1; - } -runTestCase(testcase); + +assert.sameValue(countProp1, 1, 'countProp1'); +assert.sameValue(countProp2, 1, 'countProp2'); +assert.sameValue(countProp3, 1, 'countProp3'); diff --git a/test/language/statements/for-in/12.6.4-2.js b/test/language/statements/for-in/12.6.4-2.js index 2fc274aa3..f2992054c 100644 --- a/test/language/statements/for-in/12.6.4-2.js +++ b/test/language/statements/for-in/12.6.4-2.js @@ -7,10 +7,8 @@ description: > The for-in Statement - the values of [[Enumerable]] attributes are not considered when determining if a property of a prototype object is shadowed by a previous object on the prototype chain -includes: [runTestCase.js] ---*/ -function testcase() { var proto = { prop: "enumerableValue" }; @@ -32,6 +30,5 @@ function testcase() { accessedProp = true; } } - return !accessedProp; - } -runTestCase(testcase); + +assert.sameValue(accessedProp, false, 'accessedProp'); diff --git a/test/language/statements/function/13.0-12-s.js b/test/language/statements/function/13.0-12-s.js index edae04cdf..6443a087a 100644 --- a/test/language/statements/function/13.0-12-s.js +++ b/test/language/statements/function/13.0-12-s.js @@ -11,13 +11,7 @@ description: > when a Function constructor is contained in strict mode code and the function constructor body is not strict flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var _13_0_12_fun = new Function(" ","eval = 42;"); _13_0_12_fun(); - return true; - - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-2-2.js b/test/language/statements/function/13.1-2-2.js index 12c1eeaea..c3e856734 100644 --- a/test/language/statements/function/13.1-2-2.js +++ b/test/language/statements/function/13.1-2-2.js @@ -6,13 +6,7 @@ es5id: 13.1-2-2 description: > eval allowed as formal parameter name of a non-strict function expression -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ eval("(function foo(eval){});"); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-1-s.js b/test/language/statements/function/13.2-1-s.js index ec7ae1bc8..3a239777b 100644 --- a/test/language/statements/function/13.2-1-s.js +++ b/test/language/statements/function/13.2-1-s.js @@ -6,14 +6,11 @@ es5id: 13.2-1-s description: > StrictMode - Writing or reading from a property named 'caller' of function objects is allowed under both strict and normal modes. -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { this.caller = 12; } var obj = new foo(); - return obj.caller === 12; - } -runTestCase(testcase); + +assert.sameValue(obj.caller, 12, 'obj.caller'); diff --git a/test/language/statements/return/12.9-1.js b/test/language/statements/return/12.9-1.js index 9a971ca0a..c2f38544c 100644 --- a/test/language/statements/return/12.9-1.js +++ b/test/language/statements/return/12.9-1.js @@ -6,10 +6,8 @@ es5id: 12.9-1 description: > The return Statement - a return statement without an expression may have a LineTerminator before the semi-colon -includes: [runTestCase.js] ---*/ -function testcase() { var sum = 0; (function innerTest() { for (var i = 1; i <= 10; i++) { @@ -20,6 +18,5 @@ function testcase() { sum += i; } })(); - return sum === 15; - } -runTestCase(testcase); + +assert.sameValue(sum, 15, 'sum'); diff --git a/test/language/statements/variable/12.2.1-10-s.js b/test/language/statements/variable/12.2.1-10-s.js index 971999ed0..726918d10 100644 --- a/test/language/statements/variable/12.2.1-10-s.js +++ b/test/language/statements/variable/12.2.1-10-s.js @@ -4,12 +4,7 @@ /*--- es5id: 12.2.1-10-s description: "Strict Mode: an indirect eval assigning into 'eval' does not throw" -includes: [runTestCase.js] ---*/ -function testcase() { var s = eval; s('eval = 42;'); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/variable/12.2.1-5-s.js b/test/language/statements/variable/12.2.1-5-s.js index 33f7dab39..5f7dee624 100644 --- a/test/language/statements/variable/12.2.1-5-s.js +++ b/test/language/statements/variable/12.2.1-5-s.js @@ -5,11 +5,6 @@ es5id: 12.2.1-5-s description: > a Function declaring var named 'eval' does not throw SyntaxError -includes: [runTestCase.js] ---*/ -function testcase() { Function('var eval;'); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/variable/12.2.1-6-s.js b/test/language/statements/variable/12.2.1-6-s.js index 1fd3571b2..28980b317 100644 --- a/test/language/statements/variable/12.2.1-6-s.js +++ b/test/language/statements/variable/12.2.1-6-s.js @@ -8,12 +8,7 @@ description: > if contained within strict mode and its body does not start with strict mode flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var f = Function('eval = 42;'); f(); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/with/12.10-0-1.js b/test/language/statements/with/12.10-0-1.js index 9f46c0c83..99d94cf07 100644 --- a/test/language/statements/with/12.10-0-1.js +++ b/test/language/statements/with/12.10-0-1.js @@ -6,11 +6,9 @@ es5id: 12.10-0-1 description: > with does not change declaration scope - vars in with are visible outside -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var o = {}; var f = function () { /* capture foo binding before executing with */ @@ -21,7 +19,4 @@ function testcase() { var foo = "12.10-0-1"; } - return f()==="12.10-0-1" - - } -runTestCase(testcase); +assert.sameValue(f(), "12.10-0-1", 'f()'); diff --git a/test/language/statements/with/12.10-0-3.js b/test/language/statements/with/12.10-0-3.js index 920491628..36be6a87a 100644 --- a/test/language/statements/with/12.10-0-3.js +++ b/test/language/statements/with/12.10-0-3.js @@ -4,11 +4,9 @@ /*--- es5id: 12.10-0-3 description: with introduces scope - that is captured by function expression -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var o = {prop: "12.10-0-3 before"}; var f; @@ -16,6 +14,5 @@ function testcase() { f = function () { return prop; } } o.prop = "12.10-0-3 after"; - return f()==="12.10-0-3 after" - } -runTestCase(testcase); + +assert.sameValue(f(), "12.10-0-3 after", 'f()'); diff --git a/test/language/statements/with/12.10-0-8.js b/test/language/statements/with/12.10-0-8.js index e3ed14604..e58d29a98 100644 --- a/test/language/statements/with/12.10-0-8.js +++ b/test/language/statements/with/12.10-0-8.js @@ -4,17 +4,13 @@ /*--- es5id: 12.10-0-8 description: with introduces scope - var initializer sets like named property -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var o = {foo: 42}; with (o) { var foo = "set in with"; } - return o.foo === "set in with"; - } -runTestCase(testcase); +assert.sameValue(o.foo, "set in with", 'o.foo'); |