Replace runTestCase with assert helpers [test/language/line-terminators]

This commit is contained in:
André Bargull 2015-08-06 18:33:54 +02:00
parent 31f027dc03
commit 4c582732d0
9 changed files with 18 additions and 45 deletions

View File

@ -6,12 +6,10 @@ es5id: 7.3-1
description: >
7.3 - ES5 recognizes the character <LS> (\u2028) as line
terminators when parsing statements
includes: [runTestCase.js]
---*/
function testcase() {
var test7_3_1, prop;
eval("test7_3_1\u2028prop = 66;");
return (prop === 66) && ((typeof test7_3_1) === "undefined");
}
runTestCase(testcase);
assert.sameValue(prop, 66, 'prop');
assert.sameValue((typeof test7_3_1), "undefined", '(typeof test7_3_1)');

View File

@ -7,14 +7,9 @@ description: >
7.3 - ES5 specifies that a multiline comment that contains a line
terminator character <LS> (\u2028) must be treated as a single
line terminator for the purposes of semicolon insertion
includes: [runTestCase.js]
---*/
function testcase() {
/*MultiLine
Comments
\u2028 var = ;
*/
return true;
}
runTestCase(testcase);

View File

@ -7,14 +7,9 @@ description: >
7.3 - ES5 specifies that a multiline comment that contains a line
terminator character <PS> (\u2029) must be treated as a single
line terminator for the purposes of semicolon insertion
includes: [runTestCase.js]
---*/
function testcase() {
/*MultiLine
Comments
\u2029 var = ;
*/
return true;
}
runTestCase(testcase);

View File

@ -7,14 +7,9 @@ description: >
7.3 - ES5 specifies that a multiline comment that contains a line
terminator character <CR> (\u000D) must be treated as a single
line terminator for the purposes of semicolon insertion
includes: [runTestCase.js]
---*/
function testcase() {
/*MultiLine
Comments
\u000D var = ;
*/
return true;
}
runTestCase(testcase);

View File

@ -7,14 +7,9 @@ description: >
7.3 - ES5 specifies that a multiline comment that contains a line
terminator character <LF> (\u000A) must be treated as a single
line terminator for the purposes of semicolon insertion
includes: [runTestCase.js]
---*/
function testcase() {
/*MultiLine
Comments
\u000A var = ;
*/
return true;
}
runTestCase(testcase);

View File

@ -4,11 +4,10 @@
/*---
es5id: 7.3-15
description: 7.3 - ES5 recognize <BOM> (\uFFFF) as a whitespace character
includes: [runTestCase.js]
---*/
function testcase() {
var prop = "a\uFFFFa";
return prop.length === 3 && prop !== "aa" && prop[1] === "\uFFFF";
}
runTestCase(testcase);
assert.sameValue(prop.length, 3, 'prop.length');
assert.notSameValue(prop, "aa", 'prop');
assert.sameValue(prop[1], "\uFFFF", 'prop[1]');

View File

@ -6,12 +6,10 @@ es5id: 7.3-2
description: >
7.3 - ES5 recognizes the character <PS> (\u2029) as line
terminators when parsing statements
includes: [runTestCase.js]
---*/
function testcase() {
var test7_3_2, prop;
eval("test7_3_2\u2029prop = 66;");
return (prop===66) && ((typeof test7_3_2) === "undefined");
}
runTestCase(testcase);
assert.sameValue(prop, 66, 'prop');
assert.sameValue((typeof test7_3_2), "undefined", '(typeof test7_3_2)');

View File

@ -6,11 +6,10 @@ es5id: 7.3-5
description: >
7.3 - ES5 recognizes the character <LS> (\u2028) as terminating
string literal
includes: [runTestCase.js]
---*/
function testcase() {
var prop = "66\u2028123";
return prop === "66\u2028123" && prop[2] === "\u2028" && prop.length === 6;
}
runTestCase(testcase);
assert.sameValue(prop, "66\u2028123", 'prop');
assert.sameValue(prop[2], "\u2028", 'prop[2]');
assert.sameValue(prop.length, 6, 'prop.length');

View File

@ -6,11 +6,10 @@ es5id: 7.3-6
description: >
7.3 - ES5 recognizes the character <PS> (\u2029) as terminating
string literal
includes: [runTestCase.js]
---*/
function testcase() {
var prop = "66\u2029123";
return prop === "66\u2029123" && prop[2] === "\u2029" && prop.length === 6;
}
runTestCase(testcase);
assert.sameValue(prop, "66\u2029123", 'prop');
assert.sameValue(prop[2], "\u2029", 'prop[2]');
assert.sameValue(prop.length, 6, 'prop.length');