blob: c0b4426d5e34d093cfaf19228bbeca9c104773cd [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_Control}+/u, "\u200E");
11f(/\p{Bidi_C}+/u, "On a dark desert highway, cool wind in my hair");
12t(/\p{AHex}+/u, "DEADBEEF");
13t(/\p{Alphabetic}+/u, "abcdefg");
14t(/\P{Alphabetic}+/u, "1234");
15t(/\p{White_Space}+/u, "\u00A0");
16t(/\p{Uppercase}+/u, "V");
17f(/\p{Lower}+/u, "U");
18t(/\p{Ideo}+/u, "字");
19f(/\p{Ideo}+/u, "x");
20
21assertThrows("/\\p{Hiragana}/u");
22assertThrows("/\\p{Bidi_Class}/u");
23assertThrows("/\\p{Bidi_C=False}/u");
24assertThrows("/\\P{Bidi_Control=Y}/u");
25assertThrows("/\\p{AHex=Yes}/u");