OLD | NEW |
---|---|
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 Loading... | |
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 t(/[x\P{OIDS}]/u, "\u1885\u1886\u2118\u212e\u309b\u309cx"); | |
jgruber
2017/04/10 13:46:50
Is this test missing anchors? Otherwise it will ma
Yang
2017/04/11 09:00:37
Good catch. Fixed.
| |
55 | |
56 t(/^\p{Other_ID_Continue}+$/u, "\u00b7\u0387\u1369\u1371\u19da"); | |
jgruber
2017/04/10 13:46:50
We could include
0x136A, 0x136B, 0x136C, 0x136D,
Yang
2017/04/11 09:00:37
Done.
| |
57 f(/\P{OIDC}/u, "\u00b7\u0387\u1369\u1371\u19da"); | |
OLD | NEW |