2016-03-10 23:23:04 +00:00
|
|
|
// Copyright 2011 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2016-06-24 01:11:08 +00:00
|
|
|
// Flags: --harmony-regexp-property
|
2016-03-10 23:23:04 +00:00
|
|
|
|
|
|
|
assertThrows("/[\\p]/u");
|
|
|
|
assertThrows("/[\\p{garbage}]/u");
|
|
|
|
assertThrows("/[\\p{}]/u");
|
|
|
|
assertThrows("/[\\p{]/u");
|
|
|
|
assertThrows("/[\\p}]/u");
|
2017-07-25 07:38:09 +00:00
|
|
|
assertThrows("/^[\\p{Lu}-\\p{Ll}]+$/u");
|
2016-03-10 23:23:04 +00:00
|
|
|
|
|
|
|
assertTrue(/^[\p{Lu}\p{Ll}]+$/u.test("ABCabc"));
|
2017-07-25 07:38:09 +00:00
|
|
|
assertTrue(/^[\p{Lu}-]+$/u.test("ABC-"));
|
2016-03-10 23:23:04 +00:00
|
|
|
assertFalse(/^[\P{Lu}\p{Ll}]+$/u.test("ABCabc"));
|
|
|
|
assertTrue(/^[\P{Lu}\p{Ll}]+$/u.test("abc"));
|
|
|
|
assertTrue(/^[\P{Lu}]+$/u.test("abc123"));
|
|
|
|
assertFalse(/^[\P{Lu}]+$/u.test("XYZ"));
|
2016-04-08 05:39:26 +00:00
|
|
|
assertTrue(/[\p{Math}]/u.test("+"));
|
|
|
|
assertTrue(/[\P{Bidi_M}]/u.test(" "));
|
|
|
|
assertTrue(/[\p{Hex}]/u.test("A"));
|
2016-03-10 23:23:04 +00:00
|
|
|
|
|
|
|
assertTrue(/^[^\P{Lu}]+$/u.test("XYZ"));
|
|
|
|
assertFalse(/^[^\p{Lu}\p{Ll}]+$/u.test("abc"));
|
|
|
|
assertFalse(/^[^\p{Lu}\p{Ll}]+$/u.test("ABC"));
|
|
|
|
assertTrue(/^[^\p{Lu}\p{Ll}]+$/u.test("123"));
|
|
|
|
assertTrue(/^[^\p{Lu}\P{Ll}]+$/u.test("abc"));
|