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 6 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"); 26