blob: dba8397e78ea13c10ff9c2e1f85665c2e1ca39f9 [file] [log] [blame]
Ben Murdochc5610432016-08-08 18:44:38 +01001// 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
Ben Murdoch61f157c2016-09-16 13:49:30 +01005// Flags: --harmony-regexp-property
Ben Murdochc5610432016-08-08 18:44:38 +01006
7function t(re, s) { assertTrue(re.test(s)); }
8function f(re, s) { assertFalse(re.test(s)); }
9
10t(/\p{Bidi_Class=L}+/u, "Is this the real life?");
11t(/\p{bc=Left_To_Right}+/u, "Is this just fantasy?");
12t(/\p{bc=AL}+/u, "السلام عليكم‎");
13t(/\p{bc=Arabic_Letter}+/u, "متشرف بمعرفتك‎");
14
15t(/\p{Line_Break=Glue}/u, "\u00A0");
16t(/\p{lb=AL}/u, "~");
17
18assertThrows("/\\p{Block=}/u");
19assertThrows("/\\p{=}/u");
20assertThrows("/\\p{=L}/u");
21assertThrows("/\\p{=Hiragana}/u");
22assertThrows("/\\p{Block=CJK=}/u");
23
24assertThrows("/\\p{Age=V8_0}/u");
25assertThrows("/\\p{General_Category=Letter}/u");
26assertThrows("/\\p{gc=L}/u");
27assertThrows("/\\p{General_Category_Mask=Letter}/u");
28assertThrows("/\\p{gcm=L}/u");