2016-02-10 16:23:53 +00:00
|
|
|
// Copyright 2016 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-02-10 16:23:53 +00:00
|
|
|
|
|
|
|
assertThrows("/\\p/u");
|
|
|
|
assertThrows("/\\p{garbage}/u");
|
|
|
|
assertThrows("/\\p{}/u");
|
|
|
|
assertThrows("/\\p{/u");
|
|
|
|
assertThrows("/\\p}/u");
|
2016-06-07 09:11:32 +00:00
|
|
|
assertThrows("/\\pL/u");
|
|
|
|
assertThrows("/\\P/u");
|
|
|
|
assertThrows("/\\P{garbage}/u");
|
|
|
|
assertThrows("/\\P{}/u");
|
|
|
|
assertThrows("/\\P{/u");
|
|
|
|
assertThrows("/\\P}/u");
|
|
|
|
assertThrows("/\\PL/u");
|
2016-02-10 16:23:53 +00:00
|
|
|
|
|
|
|
assertTrue(/\p{Ll}/u.test("a"));
|
|
|
|
assertFalse(/\P{Ll}/u.test("a"));
|
|
|
|
assertTrue(/\P{Ll}/u.test("A"));
|
|
|
|
assertFalse(/\p{Ll}/u.test("A"));
|
|
|
|
assertTrue(/\p{Ll}/u.test("\u{1D7BE}"));
|
|
|
|
assertFalse(/\P{Ll}/u.test("\u{1D7BE}"));
|
|
|
|
assertFalse(/\p{Ll}/u.test("\u{1D5E3}"));
|
|
|
|
assertTrue(/\P{Ll}/u.test("\u{1D5E3}"));
|
|
|
|
|
|
|
|
assertTrue(/\p{Ll}/iu.test("a"));
|
|
|
|
assertTrue(/\p{Ll}/iu.test("\u{118D4}"));
|
|
|
|
assertTrue(/\p{Ll}/iu.test("A"));
|
|
|
|
assertTrue(/\p{Ll}/iu.test("\u{118B4}"));
|
2016-06-14 15:13:56 +00:00
|
|
|
assertTrue(/\P{Ll}/iu.test("a"));
|
|
|
|
assertTrue(/\P{Ll}/iu.test("\u{118D4}"));
|
|
|
|
assertTrue(/\P{Ll}/iu.test("A"));
|
|
|
|
assertTrue(/\P{Ll}/iu.test("\u{118B4}"));
|
2016-02-10 16:23:53 +00:00
|
|
|
|
|
|
|
assertTrue(/\p{Lu}/u.test("A"));
|
|
|
|
assertFalse(/\P{Lu}/u.test("A"));
|
|
|
|
assertTrue(/\P{Lu}/u.test("a"));
|
|
|
|
assertFalse(/\p{Lu}/u.test("a"));
|
|
|
|
assertTrue(/\p{Lu}/u.test("\u{1D5E3}"));
|
|
|
|
assertFalse(/\P{Lu}/u.test("\u{1D5E3}"));
|
|
|
|
assertFalse(/\p{Lu}/u.test("\u{1D7BE}"));
|
|
|
|
assertTrue(/\P{Lu}/u.test("\u{1D7BE}"));
|
|
|
|
|
|
|
|
assertTrue(/\p{Lu}/iu.test("a"));
|
|
|
|
assertTrue(/\p{Lu}/iu.test("\u{118D4}"));
|
|
|
|
assertTrue(/\p{Lu}/iu.test("A"));
|
|
|
|
assertTrue(/\p{Lu}/iu.test("\u{118B4}"));
|
2016-06-14 15:13:56 +00:00
|
|
|
assertTrue(/\P{Lu}/iu.test("a"));
|
|
|
|
assertTrue(/\P{Lu}/iu.test("\u{118D4}"));
|
|
|
|
assertTrue(/\P{Lu}/iu.test("A"));
|
|
|
|
assertTrue(/\P{Lu}/iu.test("\u{118B4}"));
|
2016-02-10 16:23:53 +00:00
|
|
|
|
|
|
|
assertTrue(/\p{Sm}/u.test("+"));
|
|
|
|
assertFalse(/\P{Sm}/u.test("+"));
|
|
|
|
assertTrue(/\p{Sm}/u.test("\u{1D6C1}"));
|
|
|
|
assertFalse(/\P{Sm}/u.test("\u{1D6C1}"));
|
|
|
|
|
|
|
|
assertFalse(/\p{L}/u.test("\uA6EE"));
|
|
|
|
assertTrue(/\P{L}/u.test("\uA6EE"));
|
2016-03-09 19:05:02 +00:00
|
|
|
|
|
|
|
assertTrue(/\p{Lowercase_Letter}/u.test("a"));
|
2016-03-21 19:21:22 +00:00
|
|
|
assertTrue(/\p{Math_Symbol}/u.test("+"));
|
2016-11-18 06:09:26 +00:00
|
|
|
|
|
|
|
assertTrue(/\p{gc=Ll}/u.test("a"));
|
|
|
|
assertTrue(/\p{General_Category=Math_Symbol}/u.test("+"));
|
|
|
|
assertTrue(/\p{General_Category=L}/u.test("X"));
|