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

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

Issue 2808803002: [regexp] implement \p{Other_ID_Start} and \p{Other_ID_Continue}. (Closed)
Patch Set: address comments Created 3 years, 8 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-regexp-property 5 // Flags: --harmony-regexp-property
6 6
7 function t(re, s) { assertTrue(re.test(s)); } 7 function t(re, s) { assertTrue(re.test(s)); }
8 function f(re, s) { assertFalse(re.test(s)); } 8 function f(re, s) { assertFalse(re.test(s)); }
9 9
10 t(/\p{ASCII}+/u, "abc123"); 10 t(/\p{ASCII}+/u, "abc123");
(...skipping 26 matching lines...) Expand all
37 t(/\p{Assigned}+/u, "🄰🄱🄲"); 37 t(/\p{Assigned}+/u, "🄰🄱🄲");
38 f(/\p{Assigned}+/u, "\ufdd0"); 38 f(/\p{Assigned}+/u, "\ufdd0");
39 f(/\p{Assigned}+/u, "\u{fffff}"); 39 f(/\p{Assigned}+/u, "\u{fffff}");
40 40
41 f(/\P{Assigned}+/u, "123"); 41 f(/\P{Assigned}+/u, "123");
42 f(/\P{Assigned}+/u, "🄰🄱🄲"); 42 f(/\P{Assigned}+/u, "🄰🄱🄲");
43 t(/\P{Assigned}+/u, "\ufdd0"); 43 t(/\P{Assigned}+/u, "\ufdd0");
44 t(/\P{Assigned}+/u, "\u{fffff}"); 44 t(/\P{Assigned}+/u, "\u{fffff}");
45 f(/\P{Assigned}/u, ""); 45 f(/\P{Assigned}/u, "");
46 46
47 t(/[^\P{Assigned}]+/u, "123"); 47 f(/[^\u1234\p{ASCII}]+/u, "\u1234");
48 f(/[\P{Assigned}]+/u, "🄰🄱🄲"); 48 t(/[x\P{ASCII}]+/u, "x");
49 f(/[^\P{Assigned}]+/u, "\ufdd0"); 49 t(/[\u1234\p{ASCII}]+/u, "\u1234");
50 t(/[\P{Assigned}]+/u, "\u{fffff}"); 50
51 f(/[\P{Assigned}]/u, ""); 51 t(/^\p{Other_ID_Start}+$/u, "\u1885\u1886\u2118\u212e\u309b\u309c");
52 f(/\P{OIDS}/u, "\u1885\u1886\u2118\u212e\u309b\u309c");
53 f(/^[x\P{Other_ID_Start}]+$/u, "\u1885\u1886\u2118\u212e\u309b\u309cx");
54 f(/[x\P{OIDS}]/u, "\u1885\u1886\u2118\u212e\u309b\u309c");
55
56 var other_id_continue = "\u00b7\u0387\u1369\u136a\u136b\u136c" +
57 "\u136d\u136e\u136f\u1370\u1371\u19da";
58 t(/^\p{Other_ID_Continue}+$/u, other_id_continue);
59 f(/\P{OIDC}/u, other_id_continue);
OLDNEW
« no previous file with comments | « src/regexp/regexp-parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698