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