Index: test/mjsunit/harmony/regexp-property-blocks.js |
diff --git a/test/mjsunit/harmony/regexp-property-blocks.js b/test/mjsunit/harmony/regexp-property-blocks.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4d7e126d17854bf117a927bef941e24a2d7b150f |
--- /dev/null |
+++ b/test/mjsunit/harmony/regexp-property-blocks.js |
@@ -0,0 +1,37 @@ |
+// 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. |
+ |
+// Flags: --harmony-regexp-property --harmony-unicode-regexps |
+ |
+function t(re, s) { assertTrue(re.test(s)); } |
+function f(re, s) { assertFalse(re.test(s)); } |
+ |
+t(/\p{ASCII}+/u, "."); |
+t(/\p{ASCII}+/u, "supercalifragilisticexpialidocious"); |
+t(/\p{BasicLatin}+/u, "."); |
+t(/\p{BasicLatin}+/u, "supercalifragilisticexpialidocious"); |
+t(/\p{InBasic_Latin}+/u, "."); |
+t(/\p{InBasic_Latin}+/u, "supercalifragilisticexpialidocious"); |
+t(/\p{InBasicLatin}+/u, "."); |
+t(/\p{InBasicLatin}+/u, "supercalifragilisticexpialidocious"); |
+ |
+t(/\p{CJK}+/u, "话说天下大势,分久必合,合久必分"); |
+t(/\p{InCJK}+/u, "吾庄后有一桃园,花开正盛"); |
+f(/\p{CJKUnifiedIdeographs}+/u, "おはようございます"); |
+f(/\p{In CJK unified ideographs}+/u, |
+ "Something is rotten in the state of Denmark"); |
+ |
+t(/\p{Latin_1}+/u, "Wie froh bin ich, daß ich weg bin!"); |
+f(/\p{ASCII}+/u, "奔腾千里荡尘埃,渡水登山紫雾开"); |
+f(/\p{Latin_1}+/u, "いただきます"); |
+ |
+t(/\p{InHiragana}/u, "いただきます"); |
+t(/\p{Hiragana}/u, "\u{1b001}"); // This refers to the script "Hiragana". |
+t(/\p{IsHiragana}/u, "\u{1b001}"); // This refers to the script "Hiragana". |
+f(/\p{InHiragana}/u, "\u{1b001}"); // This refers to the block "Hiragana". |
+ |
+t(/\p{GreekAndCoptic}/u, "ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ"); |
+t(/\p{InGreek}/u, "μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος"); |
+ |
+assertThrows("/\\p{In}/u"); |