Simplify and de-duplicate tests

This commit is contained in:
Mike Pennisi 2019-03-16 21:39:19 -04:00
parent d7fdfe9571
commit 66b61a9fd6
10 changed files with 7 additions and 216 deletions

View File

@ -1,40 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: FORM FEED (U+000C) between any two tokens is allowed
es5id: 7.2_A1.3_T1
description: Insert FORM FEED(\u000C and \f) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u000Cvar\u000Cx\u000C=\u000C1\u000C; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u000Cvar\\u000Cx\\u000C=\\u000C1\\u000C; result = x;"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u000C" + "var" + "\u000C" + "x" + "\u000C" + "=" + "\u000C" + "2" + "\u000C; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u000C" + "var" + "\\u000C" + "x" + "\\u000C" + "=" + "\\u000C" + "2" + "\\u000C; result = x;"); result === 2. Actual: ' + (result));
}
//CHECK#3
eval("\fvar\fx\f=\f3\f; result = x;");
if (result !== 3) {
$ERROR('#3: eval("\\fvar\\fx\\f=\\f3\\f; result = x;"); result === 3. Actual: ' + (result));
}
//CHECK#4
eval("\f" + "var" + "\f" + "x" + "\f" + "=" + "\f" + "4" + "\f; result = x;");
if (result !== 4) {
$ERROR('#4: eval("\\f" + "var" + "\\f" + "x" + "\\f" + "=" + "\\f" + "4" + "\\f; result = x;"); result === 4. Actual: ' + (result));
}
//CHECK#5
eval("\u000C" + "var" + "\f" + "x" + "\u000C" + "=" + "\f" + "5" + "\u000C; result = x;");
if (result !== 5) {
$ERROR('#5: eval("\\u000C" + "var" + "\\f" + "x" + "\\u000C" + "=" + "\\f" + "5" + "\\u000C; result = x;"); result === 5. Actual: ' + (result));
}

View File

@ -7,14 +7,6 @@ es5id: 7.2_A1.3_T2
description: Insert real FORM FEED between tokens of var x=1
---*/
//CHECK#1
var x = 1 ;
if (x !== 1) {
$ERROR('#1: var x = 1 ; x === 1. Actual: ' + (x));
}
//CHECK#2
eval(" var\fx =\f1 ");
if (x !== 1) {
$ERROR('#2: var\\fx =\\f1 ; x === 1. Actual: ' + (x));
}
assert.sameValue(x, 1);

View File

@ -1,40 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: HORIZONTAL TAB (U+0009) between any two tokens is allowed
es5id: 7.2_A1.1_T1
description: Insert HORIZONTAL TAB(\u0009 and \t) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u0009var\u0009x\u0009=\u00091\u0009; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u0009var\\u0009x\\u0009=\\u00091\\u0009; result = x;"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u0009" + "var" + "\u0009" + "x" + "\u0009" + "=" + "\u0009" + "2" + "\u0009; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u0009" + "var" + "\\u0009" + "x" + "\\u0009" + "=" + "\\u0009" + "2" + "\\u0009; result = x;"); result === 2. Actual: ' + (result));
}
//CHECK#3
eval("\tvar\tx\t=\t3\t; result = x;");
if (result !== 3) {
$ERROR('#3: eval("\\tvar\\tx\\t=\\t3\\t; result = x;"); x === 3. Actual: ' + (result));
}
//CHECK#4
eval("\t" + "var" + "\t" + "x" + "\t" + "=" + "\t" + "4" + "\t; result = x;");
if (result !== 4) {
$ERROR('#4: eval("\\t" + "var" + "\\t" + "x" + "\\t" + "=" + "\\t" + "4" + "\\t; result = x;"); result === 4. Actual: ' + (result));
}
//CHECK#5
eval("\u0009" + "var" + "\t" + "x" + "\u0009" + "=" + "\t" + "5" + "\u0009; result = x;");
if (result !== 5) {
$ERROR('#5: eval("\\u0009" + "var" + "\\t" + "x" + "\\u0009" + "=" + "\\t" + "5" + "\\u0009; result = x;"); result === 5. Actual: ' + (result));
}

View File

@ -7,15 +7,6 @@ es5id: 7.2_A1.1_T2
description: Insert real HORIZONTAL TAB between tokens of var x=1
---*/
//CHECK#1
var x = 1 ;
if (x !== 1) {
$ERROR('#1: var x = 1 ; x === 1. Actual: ' + (x));
}
//CHECK#2
var result;
eval(" var\tx =\t2 ; result = x;");
if (result !== 2) {
$ERROR('#2: var\\tx =\\t1 ; result = x; result === 2. Actual: ' + (result));
}
assert.sameValue(x, 1);

View File

@ -1,22 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: NO-BREAK SPACE (U+00A0) between any two tokens is allowed
es5id: 7.2_A1.5_T1
description: Insert NO-BREAK SPACE(\u00A0) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u00A0var\u00A0x\u00A0=\u00A01\u00A0; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u00A0var\\u00A0x\\u00A0=\\u00A01\\u00A0; result = x;"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u00A0" + "var" + "\u00A0" + "x" + "\u00A0" + "=" + "\u00A0" + "2" + "\u00A0; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u00A0" + "var" + "\\u00A0" + "x" + "\\u00A0" + "=" + "\\u00A0" + "2" + "\\u00A0; result = x;"); result === 2. Actual: ' + (result));
}

View File

@ -7,16 +7,6 @@ es5id: 7.2_A1.5_T2
description: Insert real NO-BREAK SPACE between tokens of var x=1
---*/
var result;
//CHECK#1
eval("\u00A0var x\u00A0= 1\u00A0; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0; result = x;"); result === 1. Actual: ' + (result));
}
//CHECK#2
 var x = 2 ;
if (x !== 2) {
$ERROR('#2:  var x = 1 ; x === 2. Actual: ' + (x));
}
assert.sameValue(x, 2);

View File

@ -1,22 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: SPACE (U+0020) between any two tokens is allowed
es5id: 7.2_A1.4_T1
description: Insert SPACE(\u0020) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u0020var\u0020x\u0020=\u00201\u0020; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u0020var\\u0020x\\u0020=\\u00201\\u0020; result = x;"); result === 1;');
}
//CHECK#2
eval("\u0020" + "var" + "\u0020" + "x" + "\u0020" + "=" + "\u0020" + "2" + "\u0020; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u0020" + "var" + "\\u0020" + "x" + "\\u0020" + "=" + "\\u0020" + "2" + "\\u0020; result = x;"); result === 2. Actual: ' + (result));
}

View File

@ -7,16 +7,6 @@ es5id: 7.2_A1.4_T2
description: Insert real SPACE between tokens of var x=1
---*/
var result;
//CHECK#1
eval("\u0020var x\u0020= 1\u0020; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u0020var x\\u0020= 1\\u0020; result = x;"); result === 1. Actual: ' + (result));
}
//CHECK#2
var x = 2 ;
if (x !== 2) {
$ERROR('#2: var x = 2 ; x === 2. Actual: ' + (x));
}
assert.sameValue(x, 2);

View File

@ -1,40 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: VERTICAL TAB (U+000B) between any two tokens is allowed
es5id: 7.2_A1.2_T1
description: Insert VERTICAL TAB(\u000B and \v) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u000Bvar\u000Bx\u000B=\u000B1\u000B; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u000Bvar\\u000Bx\\u000B=\\u000B1\\u000B; result = x;"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u000B" + "var" + "\u000B" + "x" + "\u000B" + "=" + "\u000B" + "2" + "\u000B; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u000B" + "var" + "\\u000B" + "x" + "\\u000B" + "=" + "\\u000B" + "2" + "\\u000B; result = x;"); result === 2. Actual: ' + (result));
}
//CHECK#3
eval("\vvar\vx\v=\v3\v; result = x;");
if (result !== 3) {
$ERROR('#3: eval("\\vvar\\vx\\v=\\v3\\v; result = x;"); x === 3. Actual: ' + (result));
}
//CHECK#4
eval("\v" + "var" + "\v" + "x" + "\v" + "=" + "\v" + "4" + "\v; result = x;");
if (result !== 4) {
$ERROR('#4: eval("\\v" + "var" + "\\v" + "x" + "\\v" + "=" + "\\v" + "4" + "\\v; result = x;"); result === 4. Actual: ' + (result));
}
//CHECK#5
eval("\u000B" + "var" + "\v" + "x" + "\u000B" + "=" + "\v" + "5" + "\u000B; result = x;");
if (result !== 5) {
$ERROR('#5: eval("\\u000B" + "var" + "\\v" + "x" + "\\u000B" + "=" + "\\v" + "5" + "\\u000B; result = x;"); result === 5. Actual: ' + (result));
}

View File

@ -7,14 +7,6 @@ es5id: 7.2_A1.2_T2
description: Insert real VERTICAL TAB between tokens of var x=1
---*/
//CHECK#1
var x = 1 ;
if (x !== 1) {
$ERROR('#1: var x = 1 ; x === 1. Actual: ' + (x));
}
//CHECK#2
eval(" var\vx =\v1 ");
if (x !== 1) {
$ERROR('#2: var\\vx =\\v1 ; x === 1. Actual: ' + (x));
}
assert.sameValue(x, 1);