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

Side by Side Diff: test/mjsunit/harmony/unicode-regexp-property-class.js

Issue 1685593002: [regexp] experimental implementation for \p property class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add ignore case test and simplify parsing Created 4 years, 10 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/regexp/regexp-parser.cc ('k') | test/mjsunit/mjsunit.status » ('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 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-regexp-property --harmony-unicode-regexps
6
7 assertThrows("/\\p/u");
8 assertThrows("/\\p{garbage}/u");
9 assertThrows("/\\p{}/u");
10 assertThrows("/\\p{/u");
11 assertThrows("/\\p}/u");
12 assertThrows("/\p{Math}/u");
13 assertThrows("/\p{Bidi_M}/u");
14 assertThrows("/\p{Hex}/u");
15
16 assertTrue(/\p{Ll}/u.test("a"));
17 assertFalse(/\P{Ll}/u.test("a"));
18 assertTrue(/\P{Ll}/u.test("A"));
19 assertFalse(/\p{Ll}/u.test("A"));
20 assertTrue(/\p{Ll}/u.test("\u{1D7BE}"));
21 assertFalse(/\P{Ll}/u.test("\u{1D7BE}"));
22 assertFalse(/\p{Ll}/u.test("\u{1D5E3}"));
23 assertTrue(/\P{Ll}/u.test("\u{1D5E3}"));
24
25 assertTrue(/\p{Ll}/iu.test("a"));
26 assertTrue(/\p{Ll}/iu.test("\u{118D4}"));
27 assertTrue(/\p{Ll}/iu.test("A"));
28 assertTrue(/\p{Ll}/iu.test("\u{118B4}"));
29 assertFalse(/\P{Ll}/iu.test("a"));
30 assertFalse(/\P{Ll}/iu.test("\u{118D4}"));
31 assertFalse(/\P{Ll}/iu.test("A"));
32 assertFalse(/\P{Ll}/iu.test("\u{118B4}"));
33
34 assertTrue(/\p{Lu}/u.test("A"));
35 assertFalse(/\P{Lu}/u.test("A"));
36 assertTrue(/\P{Lu}/u.test("a"));
37 assertFalse(/\p{Lu}/u.test("a"));
38 assertTrue(/\p{Lu}/u.test("\u{1D5E3}"));
39 assertFalse(/\P{Lu}/u.test("\u{1D5E3}"));
40 assertFalse(/\p{Lu}/u.test("\u{1D7BE}"));
41 assertTrue(/\P{Lu}/u.test("\u{1D7BE}"));
42
43 assertTrue(/\p{Lu}/iu.test("a"));
44 assertTrue(/\p{Lu}/iu.test("\u{118D4}"));
45 assertTrue(/\p{Lu}/iu.test("A"));
46 assertTrue(/\p{Lu}/iu.test("\u{118B4}"));
47 assertFalse(/\P{Lu}/iu.test("a"));
48 assertFalse(/\P{Lu}/iu.test("\u{118D4}"));
49 assertFalse(/\P{Lu}/iu.test("A"));
50 assertFalse(/\P{Lu}/iu.test("\u{118B4}"));
51
52 assertTrue(/\p{Sm}/u.test("+"));
53 assertFalse(/\P{Sm}/u.test("+"));
54 assertTrue(/\p{Sm}/u.test("\u{1D6C1}"));
55 assertFalse(/\P{Sm}/u.test("\u{1D6C1}"));
56
57 assertTrue(/\pL/u.test("a"));
58 assertFalse(/\PL/u.test("a"));
59 assertFalse(/\pL/u.test("1"));
60 assertTrue(/\PL/u.test("1"));
61 assertTrue(/\pL/u.test("\u1FAB"));
62 assertFalse(/\PL/u.test("\u1FAB"));
63 assertFalse(/\p{L}/u.test("\uA6EE"));
64 assertTrue(/\P{L}/u.test("\uA6EE"));
OLDNEW
« no previous file with comments | « src/regexp/regexp-parser.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698