Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: LayoutTests/fast/js/script-tests/regexp-ranges-and-escaped-hyphens.js

Issue 20867002: Remove old tests that have been migrated to the v8 repo. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove unused script-tests as well Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 description(
2 'Tests for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=21232">#21232</a >, and related range issues described in bug.'
3 );
4
5 // Basic test for ranges - one to three and five are in regexp, four is not, and '-' should not match
6 var regexp01 = /[1-35]+/.exec("-12354");
7 shouldBe('regexp01.toString()', '"1235"');
8 // Tests inserting an escape character class into the above pattern - where the spaces fall within the
9 // range it is no longer a range - hyphens should now match, two should not.
10 var regexp01a = /[\s1-35]+/.exec("-123 54");
11 shouldBe('regexp01a.toString()', '"123 5"');
12
13 // These are invalid ranges, according to ECMA-262, but we allow them.
14 var regexp01b = /[1\s-35]+/.exec("21-3 54");
15 shouldBe('regexp01b.toString()', '"1-3 5"');
16 var regexp01c = /[1-\s35]+/.exec("21-3 54");
17 shouldBe('regexp01c.toString()', '"1-3 5"');
18
19 var regexp01d = /[1-3\s5]+/.exec("-123 54");
20 shouldBe('regexp01d.toString()', '"123 5"');
21 var regexp01e = /[1-35\s5]+/.exec("-123 54");
22 shouldBe('regexp01e.toString()', '"123 5"');
23 // hyphens are normal charaters if a range is not fully specified.
24 var regexp01f = /[-3]+/.exec("2-34");
25 shouldBe('regexp01f.toString()', '"-3"');
26 var regexp01g = /[2-]+/.exec("12-3");
27 shouldBe('regexp01g.toString()', '"2-"');
28
29 // Similar to the above tests, but where the hyphen is escaped this is never a r ange.
30 var regexp02 = /[1\-35]+/.exec("21-354");
31 shouldBe('regexp02.toString()', '"1-35"');
32 // As above.
33 var regexp02a = /[\s1\-35]+/.exec("21-3 54");
34 shouldBe('regexp02a.toString()', '"1-3 5"');
35 var regexp02b = /[1\s\-35]+/.exec("21-3 54");
36 shouldBe('regexp02b.toString()', '"1-3 5"');
37 var regexp02c = /[1\-\s35]+/.exec("21-3 54");
38 shouldBe('regexp02c.toString()', '"1-3 5"');
39 var regexp02d = /[1\-3\s5]+/.exec("21-3 54");
40 shouldBe('regexp02d.toString()', '"1-3 5"');
41 var regexp02e = /[1\-35\s5]+/.exec("21-3 54");
42 shouldBe('regexp02e.toString()', '"1-3 5"');
43
44 // Test that an escaped hyphen can be used as a bound on a range.
45 var regexp03a = /[\--0]+/.exec(",-.01");
46 shouldBe('regexp03a.toString()', '"-.0"');
47 var regexp03b = /[+-\-]+/.exec("*+,-.");
48 shouldBe('regexp03b.toString()', '"+,-"');
49
50 // The actual bug reported.
51 var bug21232 = (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test('@');
52 shouldBe('bug21232', 'false');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698