Skip to content
Snippets Groups Projects
Commit ebab7cf0 authored by André Bargull's avatar André Bargull
Browse files

Clean-up test comments and remove invalid tests

- 15.10.2.15-3-1 and 15.10.2.15-3-2 are both invalid (U+002F (SOLIDUS) instead of U+005C (REVERSE SOLIDUS) was used to start an escape sequence).
- 15.10.4.1-2 and 15.10.2.2-1 are identical tests, delete the latter.
- Update tests to avoid using runTestCase() function.
- Update multiple test infos to point to correct algorithm step (CharacterRange step 6 instead of step 1).
parent f4e17963
Branches
No related tags found
No related merge requests found
Showing
with 73 additions and 156 deletions
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 15.10.2.15-3-1
description: >
Pattern - SyntaxError was thrown when 'A' does not contain exactly
one character (15.10.2.5 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
try {
var regExp = new RegExp("^[/w-c]$");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 15.10.2.15-3-2
description: >
Pattern - SyntaxError was thrown when 'B' does not contain exactly
one character (15.10.2.5 step 3)
includes: [runTestCase.js]
---*/
function testcase() {
try {
var regExp = new RegExp("^[a-/w]$");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
...@@ -10,16 +10,8 @@ description: > ...@@ -10,16 +10,8 @@ description: >
Pattern - SyntaxError was thrown when one character in CharSet 'A' Pattern - SyntaxError was thrown when one character in CharSet 'A'
greater than one character in CharSet 'B' (15.10.2.15 greater than one character in CharSet 'B' (15.10.2.15
CharacterRange step 6) CharacterRange step 6)
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.throws(SyntaxError, function() {
try { var regExp = new RegExp("^[z-a]$");
var regExp = new RegExp("^[z-a]$"); });
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution of this code must retain the above
// copyright and this notice and otherwise comply with the Use Terms.
/*---
es5id: 15.10.2.2-1
description: Pattern - SyntaxError was thrown when compile a pattern
includes: [runTestCase.js]
---*/
function testcase() {
try {
var regExp = new RegExp("\\");
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
...@@ -9,16 +9,8 @@ es5id: 15.10.2.5-3-1 ...@@ -9,16 +9,8 @@ es5id: 15.10.2.5-3-1
description: > description: >
Term - SyntaxError was thrown when max is finite and less than min Term - SyntaxError was thrown when max is finite and less than min
(15.10.2.5 step 3) (15.10.2.5 step 3)
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.throws(SyntaxError, function() {
try { var regExp = new RegExp("0{2,1}");
var regExp = new RegExp("0{2,1}"); });
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
...@@ -7,14 +7,10 @@ ...@@ -7,14 +7,10 @@
/*--- /*---
es5id: 15.10.4.1-1 es5id: 15.10.4.1-1
description: > description: >
RegExp - no TypeError is thrown when pattern is an object whose RegExp - no TypeError is thrown when pattern is an object and
[[Class]] property is 'RegExp' and flags is not undefined has a [[RegExpMatcher]] internal slot, and flags is not undefined
includes: [runTestCase.js]
---*/ ---*/
function testcase() { var regObj = new RegExp();
var regObj = new RegExp(); var regExpObj = new RegExp(regObj, "g");
var regExpObj = new RegExp(regObj, "g"); assert(regExpObj.global);
return regExpObj.global;
}
runTestCase(testcase);
...@@ -9,16 +9,8 @@ es5id: 15.10.4.1-2 ...@@ -9,16 +9,8 @@ es5id: 15.10.4.1-2
description: > description: >
RegExp - the thrown error is SyntaxError instead of RegExpError RegExp - the thrown error is SyntaxError instead of RegExpError
when the characters of 'P' do not have the syntactic form Pattern when the characters of 'P' do not have the syntactic form Pattern
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.throws(SyntaxError, function() {
try { var regExpObj = new RegExp('\\');
var regExpObj = new RegExp('\\'); });
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
...@@ -9,16 +9,8 @@ es5id: 15.10.4.1-3 ...@@ -9,16 +9,8 @@ es5id: 15.10.4.1-3
description: > description: >
RegExp - the thrown error is SyntaxError instead of RegExpError RegExp - the thrown error is SyntaxError instead of RegExpError
when 'F' contains any character other than 'g', 'i', or 'm' when 'F' contains any character other than 'g', 'i', or 'm'
includes: [runTestCase.js]
---*/ ---*/
function testcase() { assert.throws(SyntaxError, function() {
try { var regExpObj = new RegExp('abc', 'a');
var regExpObj = new RegExp('abc', 'a'); });
return false;
} catch (e) {
return e instanceof SyntaxError;
}
}
runTestCase(testcase);
...@@ -7,16 +7,6 @@ ...@@ -7,16 +7,6 @@
/*--- /*---
es5id: 15.10.4.1-4 es5id: 15.10.4.1-4
description: RegExp - the SyntaxError is not thrown when flags is 'gim' description: RegExp - the SyntaxError is not thrown when flags is 'gim'
includes: [runTestCase.js]
---*/ ---*/
function testcase() { var regExpObj = new RegExp('abc', 'gim');
try {
var regExpObj = new RegExp('abc', 'gim');
return true;
} catch (e) {
return false;
}
}
runTestCase(testcase);
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T1 es5id: 15.10.2.15_A1_T1
description: > description: >
Checking if execution of "/[b-ac-e]/.exec("a")" leads to throwing Checking if execution of "/[b-ac-e]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T10 es5id: 15.10.2.15_A1_T10
description: > description: >
Checking if execution of "/[\10b-G]/.exec("a")" leads to throwing Checking if execution of "/[\10b-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T11 es5id: 15.10.2.15_A1_T11
description: > description: >
Checking if execution of "/[\bd-G]/.exec("a")" leads to throwing Checking if execution of "/[\bd-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T12 es5id: 15.10.2.15_A1_T12
description: > description: >
Checking if execution of "/[\Bd-G]/.exec("a")" leads to throwing Checking if execution of "/[\Bd-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T13 es5id: 15.10.2.15_A1_T13
description: > description: >
Checking if execution of "/[\td-G]/.exec("a")" leads to throwing Checking if execution of "/[\td-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T14 es5id: 15.10.2.15_A1_T14
description: > description: >
Checking if execution of "/[\nd-G]/.exec("a")" leads to throwing Checking if execution of "/[\nd-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T15 es5id: 15.10.2.15_A1_T15
description: > description: >
Checking if execution of "/[\vd-G]/.exec("a")" leads to throwing Checking if execution of "/[\vd-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T16 es5id: 15.10.2.15_A1_T16
description: > description: >
Checking if execution of "/[\fd-G]/.exec("a")" leads to throwing Checking if execution of "/[\fd-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T17 es5id: 15.10.2.15_A1_T17
description: > description: >
Checking if execution of "/[\rd-G]/.exec("a")" leads to throwing Checking if execution of "/[\rd-G]/.exec("a")" leads to throwing
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T18 es5id: 15.10.2.15_A1_T18
description: > description: >
Checking if execution of "/[\c0001d-G]/.exec("1")" leads to Checking if execution of "/[\c0001d-G]/.exec("1")" leads to
......
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
info: > info: >
The internal helper function CharacterRange takes two CharSet parameters A and B and performs the The internal helper function CharacterRange takes two CharSet parameters A and B and performs the
following: following:
If A does not contain exactly one character or B does not contain exactly one character then throw 2. Let a be the one character in CharSet A.
a SyntaxError exception 3. Let b be the one character in CharSet B.
4. Let i be the character value of character a.
5. Let j be the character value of character b.
6. If i > j, throw a SyntaxError exception.
es5id: 15.10.2.15_A1_T19 es5id: 15.10.2.15_A1_T19
description: > description: >
Checking if execution of "/[\x0061d-G]/.exec("1")" leads to Checking if execution of "/[\x0061d-G]/.exec("1")" leads to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment