Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 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 | |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 5 | // Flags: --harmony-regexp-property |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 6 | |
| 7 | function t(re, s) { assertTrue(re.test(s)); } |
| 8 | function f(re, s) { assertFalse(re.test(s)); } |
| 9 | |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 10 | t(/\p{Script=Common}+/u, "."); |
| 11 | f(/\p{Script=Common}+/u, "supercalifragilisticexpialidocious"); |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 12 | |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 13 | t(/\p{Script=Han}+/u, "话说天下大势,分久必合,合久必分"); |
| 14 | t(/\p{Script=Hani}+/u, "吾庄后有一桃园,花开正盛"); |
| 15 | f(/\p{Script=Han}+/u, "おはようございます"); |
| 16 | f(/\p{Script=Hani}+/u, "Something is rotten in the state of Denmark"); |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 17 | |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 18 | t(/\p{Script=Latin}+/u, "Wie froh bin ich, daß ich weg bin!"); |
| 19 | t(/\p{Script=Latn}+/u, |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 20 | "It was a bright day in April, and the clocks were striking thirteen"); |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 21 | f(/\p{Script=Latin}+/u, "奔腾千里荡尘埃,渡水登山紫雾开"); |
| 22 | f(/\p{Script=Latn}+/u, "いただきます"); |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 23 | |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 24 | t(/\p{sc=Hiragana}/u, "いただきます"); |
| 25 | t(/\p{sc=Hira}/u, "ありがとうございました"); |
| 26 | f(/\p{sc=Hiragana}/u, |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 27 | "Als Gregor Samsa eines Morgens aus unruhigen Träumen erwachte"); |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 28 | f(/\p{sc=Hira}/u, "Call me Ishmael"); |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 29 | |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 30 | t(/\p{sc=Phoenician}/u, "\u{10900}\u{1091a}"); |
| 31 | t(/\p{sc=Phnx}/u, "\u{1091f}\u{10916}"); |
| 32 | f(/\p{sc=Phoenician}/u, "Arthur est un perroquet"); |
| 33 | f(/\p{sc=Phnx}/u, "设心狠毒非良士,操卓原来一路人"); |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 34 | |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 35 | t(/\p{sc=Grek}/u, "ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ"); |
| 36 | t(/\p{sc=Greek}/u, "μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος"); |
| 37 | f(/\p{sc=Greek}/u, "高贤未服英雄志,屈节偏生杰士疑"); |
| 38 | f(/\p{sc=Greek}/u, |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 39 | "Mr. Jones, of the Manor Farm, had locked the hen-houses for the night"); |