v8/test/mjsunit/harmony/regexp-property-script-category.js
yangguo 13d18c0079 [regexp] extend property classes by script category.
R=littledan@chromium.org
BUG=v8:4743
LOG=N

Committed: https://crrev.com/22f6735ccbe2e341d341e61b9c38ce308b8da655
Cr-Commit-Position: refs/heads/master@{#34553}

Review URL: https://codereview.chromium.org/1774513002

Cr-Commit-Position: refs/heads/master@{#34562}
2016-03-07 20:10:55 +00:00

40 lines
1.6 KiB
JavaScript

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