diff options
author | K.Kosako <kosako@sofnec.co.jp> | 2020-01-22 16:55:11 +0900 |
---|---|---|
committer | K.Kosako <kosako@sofnec.co.jp> | 2020-01-22 16:55:11 +0900 |
commit | 69a50c399a5d39b9fe5ec54f749391d4950c0cf3 (patch) | |
tree | ed67392d681466b3d543a49747ac94d3d38200b7 | |
parent | 0c3de0d6e49d3717317de1cb541407e96487151c (diff) | |
download | oniguruma-69a50c399a5d39b9fe5ec54f749391d4950c0cf3.zip oniguruma-69a50c399a5d39b9fe5ec54f749391d4950c0cf3.tar.gz oniguruma-69a50c399a5d39b9fe5ec54f749391d4950c0cf3.tar.bz2 |
add some test cases
-rw-r--r-- | test/test_utf8.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_utf8.c b/test/test_utf8.c index 8c67582..328d8e0 100644 --- a/test/test_utf8.c +++ b/test/test_utf8.c @@ -1234,10 +1234,17 @@ extern int main(int argc, char* argv[]) n("(.{1,4})(.{1,4})(?<=\\2\\1)", "abcdabce"); x2("(.{1,4})(.{1,4})(?<=\\2\\1)", "abcdabceabce", 4, 12); x2("(?<=a)", "a", 1, 1); + x2("(?<=a.*\\w)z", "abbbz", 4, 5); + n("(?<=a.*\\w)z", "abb z"); + x2("(?<=a.*\\W)z", "abb z", 4, 5); + x2("(?<=a.*\\b)z", "abb z", 4, 5); x2("(?<=(?>abc))", "abc", 3, 3); x2("(?<=a\\Xz)", "abz", 3, 3); n("(?<=^a*)bc", "zabc"); n("(?<=a*\\b)b", "abc"); + x2("(?<=a+.*[efg])z", "abcdfz", 5, 6); + x2("(?<=a+.*[efg])z", "abcdfgz", 6, 7); + n("(?<=a+.*[efg])z", "abcdz"); n("^..(?<=(a{,2}))\\1z", "aaaaz"); // !!! look-behind is shortest priority x2("^..(?<=(a{,2}))\\1z", "aaz", 0, 3); // shortest priority e("(?<=(?~|zoo)a.*z)", "abcdefz", ONIGERR_INVALID_LOOK_BEHIND_PATTERN); @@ -1271,6 +1278,17 @@ extern int main(int argc, char* argv[]) x2("(a*)(.{3,}?)(?<!\\1)", "abcabcd", 0, 5); x2("(?:(a.*b)|c.*d)(?<!(?(1))azzzb)", "azzzzb", 0, 6); n("(?:(a.*b)|c.*d)(?<!(?(1))azzzb)", "azzzb"); + x2("<(?<!NT{+}abcd)", "<(?<!NT{+}abcd)", 0, 1); + x2("(?<!a.*c)def", "abbbbdef", 5, 8); + n("(?<!a.*c)def", "abbbcdef"); + x2("(?<!a.*X\\b)def", "abbbbbXdef", 7, 10); + n("(?<!a.*X\\B)def", "abbbbbXdef"); + x2("(?<!a.*[uvw])def", "abbbbbXdef", 7, 10); + n("(?<!a.*[uvw])def", "abbbbbwdef"); + x2("(?<!ab*\\S+)def", "abbbbb def", 9, 12); + x2("(?<!a.*\\S)def", "abbbbb def", 7, 10); + n("(?<!ab*\\s+)def", "abbbbb def"); + x2("(?<!ab*\\s+\\B)def", "abbbbb def", 9, 12); x2("((?(a)\\g<1>|b))", "aab", 0, 3); x2("((?(a)\\g<1>))", "aab", 0, 2); |