From 66b61a9fd63e974a51fbc89505db99f573e364cf Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Sat, 16 Mar 2019 21:39:19 -0400 Subject: [PATCH] Simplify and de-duplicate tests --- .../white-space/between-form-feed-2.js | 40 ------------------- .../language/white-space/between-form-feed.js | 10 +---- .../white-space/between-horizontal-tab-2.js | 40 ------------------- .../white-space/between-horizontal-tab.js | 11 +---- test/language/white-space/between-nbsp-2.js | 22 ---------- test/language/white-space/between-nbsp.js | 14 +------ test/language/white-space/between-space-2.js | 22 ---------- test/language/white-space/between-space.js | 14 +------ .../white-space/between-vertical-tab-2.js | 40 ------------------- .../white-space/between-vertical-tab.js | 10 +---- 10 files changed, 7 insertions(+), 216 deletions(-) delete mode 100644 test/language/white-space/between-form-feed-2.js delete mode 100644 test/language/white-space/between-horizontal-tab-2.js delete mode 100644 test/language/white-space/between-nbsp-2.js delete mode 100644 test/language/white-space/between-space-2.js delete mode 100644 test/language/white-space/between-vertical-tab-2.js diff --git a/test/language/white-space/between-form-feed-2.js b/test/language/white-space/between-form-feed-2.js deleted file mode 100644 index c4868ef684..0000000000 --- a/test/language/white-space/between-form-feed-2.js +++ /dev/null @@ -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)); -} diff --git a/test/language/white-space/between-form-feed.js b/test/language/white-space/between-form-feed.js index fdd0ac144e..784bae28b2 100644 --- a/test/language/white-space/between-form-feed.js +++ b/test/language/white-space/between-form-feed.js @@ -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); diff --git a/test/language/white-space/between-horizontal-tab-2.js b/test/language/white-space/between-horizontal-tab-2.js deleted file mode 100644 index 939ec95805..0000000000 --- a/test/language/white-space/between-horizontal-tab-2.js +++ /dev/null @@ -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)); -} diff --git a/test/language/white-space/between-horizontal-tab.js b/test/language/white-space/between-horizontal-tab.js index 25320be850..4cca79beee 100644 --- a/test/language/white-space/between-horizontal-tab.js +++ b/test/language/white-space/between-horizontal-tab.js @@ -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); diff --git a/test/language/white-space/between-nbsp-2.js b/test/language/white-space/between-nbsp-2.js deleted file mode 100644 index e9ad722303..0000000000 --- a/test/language/white-space/between-nbsp-2.js +++ /dev/null @@ -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)); -} diff --git a/test/language/white-space/between-nbsp.js b/test/language/white-space/between-nbsp.js index b99f60c0e4..f72e726a4d 100644 --- a/test/language/white-space/between-nbsp.js +++ b/test/language/white-space/between-nbsp.js @@ -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); diff --git a/test/language/white-space/between-space-2.js b/test/language/white-space/between-space-2.js deleted file mode 100644 index 0b19e2bc10..0000000000 --- a/test/language/white-space/between-space-2.js +++ /dev/null @@ -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)); -} diff --git a/test/language/white-space/between-space.js b/test/language/white-space/between-space.js index 924f1af0fa..ca84ecc2b3 100644 --- a/test/language/white-space/between-space.js +++ b/test/language/white-space/between-space.js @@ -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); diff --git a/test/language/white-space/between-vertical-tab-2.js b/test/language/white-space/between-vertical-tab-2.js deleted file mode 100644 index 724c1b2dfd..0000000000 --- a/test/language/white-space/between-vertical-tab-2.js +++ /dev/null @@ -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)); -} diff --git a/test/language/white-space/between-vertical-tab.js b/test/language/white-space/between-vertical-tab.js index 6061e67e6c..6c540e05f9 100644 --- a/test/language/white-space/between-vertical-tab.js +++ b/test/language/white-space/between-vertical-tab.js @@ -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);