Skip to content
Snippets Groups Projects
Commit 6b49b770 authored by Mike Pennisi's avatar Mike Pennisi
Browse files

Refactor LT tests for parsers: token delimiters

The tests for the parsing of line terminators were expressed using eval.
This made the tests more complex than necessary and also prevented the
tests from providing value to ECMAScript parsers.

Remove the use of eval and instead express the expectations with literal
source text. Rename the files to make each test's purpose more clear.
parent e515abfa
No related branches found
No related tags found
No related merge requests found
...@@ -3,15 +3,14 @@ ...@@ -3,15 +3,14 @@
/*--- /*---
info: LINE FEED (U+000A) may occur between any two tokens info: LINE FEED (U+000A) may occur between any two tokens
esid: sec-line-terminators
es5id: 7.3_A1.1_T2 es5id: 7.3_A1.1_T2
description: Insert real LINE FEED between tokens of var x=1 description: Insert real LINE FEED between tokens of var x=1
---*/ ---*/
//CHECK#1
var var
x x
= =
1; 1;
if (x !== 1) {
$ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); assert.sameValue(x, 1);
}
...@@ -3,20 +3,11 @@ ...@@ -3,20 +3,11 @@
/*--- /*---
info: LINE SEPARATOR (U+2028) may occur between any two tokens info: LINE SEPARATOR (U+2028) may occur between any two tokens
esid: sec-line-terminators
es5id: 7.3_A1.3 es5id: 7.3_A1.3
description: Insert LINE SEPARATOR (\u2028) between tokens of var x=1 description: Insert LINE SEPARATOR (\u2028) between tokens of var x=1
---*/ ---*/
var result; varx=1;
// CHECK#1 assert.sameValue(x, 1);
eval("\u2028var\u2028x\u2028=\u20281\u2028; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u2028var\\u2028x\\u2028=\\u20281\\u2028"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u2028" + "var" + "\u2028" + "x" + "\u2028" + "=" + "\u2028" + "2" + "\u2028; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u2028" + "var" + "\\u2028" + "x" + "\\u2028" + "=" + "\\u2028" + "2" + "\\u2028"); result === 2. Actual: ' + (result));
}
...@@ -3,20 +3,11 @@ ...@@ -3,20 +3,11 @@
/*--- /*---
info: PARAGRAPH SEPARATOR (U+2029) may occur between any two tokens info: PARAGRAPH SEPARATOR (U+2029) may occur between any two tokens
esid: sec-line-terminators
es5id: 7.3_A1.4 es5id: 7.3_A1.4
description: Insert PARAGRAPH SEPARATOR (\u2029) between tokens of var x=1 description: Insert PARAGRAPH SEPARATOR (\u2029) between tokens of var x=1
---*/ ---*/
var result; varx=1;
// CHECK#1 assert.sameValue(x, 1);
eval("\u2029var\u2029x\u2029=\u20291\u2029; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u2029var\\u2029x\\u2029=\\u20291\\u2029"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u2029" + "var" + "\u2029" + "x" + "\u2029" + "=" + "\u2029" + "2" + "\u2029; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u2029" + "var" + "\\u2029" + "x" + "\\u2029" + "=" + "\\u2029" + "2" + "\\u2029"); result === 2. Actual: ' + (result));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment