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

Side by Side Diff: test/mjsunit/harmony/unicode-regexp-ignore-case.js

Issue 2096933002: Remove all harmony runtime flags which shipped in M51 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments Created 4 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
OLDNEW
(Empty)
1 // Copyright 2016 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 // Flags: --harmony-unicode-regexps
6
7 // Non-unicode use toUpperCase mappings.
8 assertFalse(/[\u00e5]/i.test("\u212b"));
9 assertFalse(/[\u212b]/i.test("\u00e5\u1234"));
10 assertFalse(/[\u212b]/i.test("\u00e5"));
11
12 assertTrue("\u212b".toLowerCase() == "\u00e5");
13 assertTrue("\u00c5".toLowerCase() == "\u00e5");
14 assertTrue("\u00e5".toUpperCase() == "\u00c5");
15
16 // Unicode uses case folding mappings.
17 assertTrue(/\u00e5/ui.test("\u212b"));
18 assertTrue(/\u00e5/ui.test("\u00c5"));
19 assertTrue(/\u00e5/ui.test("\u00e5"));
20 assertTrue(/\u00e5/ui.test("\u212b"));
21 assertTrue(/\u00c5/ui.test("\u00e5"));
22 assertTrue(/\u00c5/ui.test("\u212b"));
23 assertTrue(/\u00c5/ui.test("\u00c5"));
24 assertTrue(/\u212b/ui.test("\u00c5"));
25 assertTrue(/\u212b/ui.test("\u00e5"));
26 assertTrue(/\u212b/ui.test("\u212b"));
27
28 // Non-BMP.
29 assertFalse(/\u{10400}/i.test("\u{10428}"));
30 assertTrue(/\u{10400}/ui.test("\u{10428}"));
31 assertTrue(/\ud801\udc00/ui.test("\u{10428}"));
32 assertTrue(/[\u{10428}]/ui.test("\u{10400}"));
33 assertTrue(/[\ud801\udc28]/ui.test("\u{10400}"));
34 assertEquals(["\uff21\u{10400}"],
35 /[\uff40-\u{10428}]+/ui.exec("\uff21\u{10400}abc"));
36 assertEquals(["abc"], /[^\uff40-\u{10428}]+/ui.exec("\uff21\u{10400}abc\uff23")) ;
37 assertEquals(["\uff53\u24bb"],
38 /[\u24d5-\uff33]+/ui.exec("\uff54\uff53\u24bb\u24ba"));
39
40 // Full mappings are ignored.
41 assertFalse(/\u00df/ui.test("SS"));
42 assertFalse(/\u1f8d/ui.test("\u1f05\u03b9"));
43
44 // Simple mappings work.
45 assertTrue(/\u1f8d/ui.test("\u1f85"));
46
47 // Common mappings work.
48 assertTrue(/\u1f6b/ui.test("\u1f63"));
49
50 // Back references.
51 assertEquals(["\u00e5\u212b\u00c5", "\u00e5"],
52 /(.)\1\1/ui.exec("\u00e5\u212b\u00c5"));
53 assertEquals(["\u{118aa}\u{118ca}", "\u{118aa}"],
54 /(.)\1/ui.exec("\u{118aa}\u{118ca}"));
55
56 // Misc.
57 assertTrue(/\u00e5\u00e5\u00e5/ui.test("\u212b\u00e5\u00c5"));
58 assertTrue(/AB\u{10400}/ui.test("ab\u{10428}"));
59
60 // Non-Latin1 maps to Latin1.
61 assertEquals(["s"], /^\u017F/ui.exec("s"));
62 assertEquals(["s"], /^\u017F/ui.exec("s\u1234"));
63 assertEquals(["as"], /^a[\u017F]/ui.exec("as"));
64 assertEquals(["as"], /^a[\u017F]/ui.exec("as\u1234"));
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/unicode-regexp-backrefs.js ('k') | test/mjsunit/harmony/unicode-regexp-ignore-case-noi18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698