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

Side by Side Diff: test/mjsunit/regexp-sort.js

Issue 1182783009: Extend big-disjunction optimization to case-independent regexps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment in test Created 5 years, 6 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
« no previous file with comments | « src/vector.h ('k') | test/mjsunit/regress/regress-crbug-482998.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 function Test(lower, upper) {
6 assertEquals(lower + "x", new RegExp(upper + "x|" + lower + "|" + lower + "cat ", "i").exec(lower + "x") + "");
7 assertEquals(upper + "x", new RegExp(upper + "x|" + lower + "|" + lower + "cat ", "i").exec(upper + "x") + "");
8 assertEquals(lower, new RegExp(lower + "|" + upper + "x|" + lower + "cat", "i" ).exec(lower + "x") + "");
9 assertEquals(upper, new RegExp(lower + "|" + upper + "x|" + lower + "cat", "i" ).exec(upper + "x") + "");
10 }
11
12 function TestFail(lower, upper) {
13 assertEquals(lower, new RegExp(upper + "x|" + lower + "|" + lower + "cat", "i" ).exec(lower + "x") + "");
14 assertEquals(upper + "x", new RegExp(upper + "x|" + lower + "|" + lower + "cat ", "i").exec(upper + "x") + "");
15 assertEquals(lower, new RegExp(lower + "|" + upper + "x|" + lower + "cat", "i" ).exec(lower + "x") + "");
16 assertEquals(upper + "x", new RegExp(lower + "|" + upper + "x|" + lower + "cat ", "i").exec(upper + "x") + "");
17 }
18
19 Test("a", "A");
20 Test("0", "0");
21 TestFail("a", "b");
22 // Small and capital o-umlaut
23 Test(String.fromCharCode(0xf6), String.fromCharCode(0xd6));
24 // Small and capital kha.
25 Test(String.fromCharCode(0x445), String.fromCharCode(0x425));
26 // Small and capital y-umlaut.
27 Test(String.fromCharCode(0xff), String.fromCharCode(0x178));
28 // Small and large Greek mu.
29 Test(String.fromCharCode(0x3bc), String.fromCharCode(0x39c));
30 // Micron and large Greek mu.
31 Test(String.fromCharCode(0xb5), String.fromCharCode(0x39c));
32 // Micron and small Greek mu.
33 Test(String.fromCharCode(0xb5), String.fromCharCode(0x3bc));
Erik Corry Chromium.org 2015/06/17 07:21:13 Firefox fails this. I think we are doing it right
34 // German double s and capital S. These are not equivalent since one is double.
35 TestFail(String.fromCharCode(0xdf), "S");
36 // Small i and Turkish capital dotted I. These are not equivalent due to
37 // 21.2.2.8.2 section 3g. One is below 128 and the other is above 127.
38 TestFail("i", String.fromCharCode(0x130));
39 // Small dotless i and I. These are not equivalent either.
40 TestFail(String.fromCharCode(0x131), "I");
OLDNEW
« no previous file with comments | « src/vector.h ('k') | test/mjsunit/regress/regress-crbug-482998.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698