From db6f38bc1b73930f1da954525464cf1986f43a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 29 Apr 2022 15:21:04 +0200 Subject: New upstream version 6.9.8 --- test/test_utf8.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'test/test_utf8.c') diff --git a/test/test_utf8.c b/test/test_utf8.c index 9822308..75392e8 100644 --- a/test/test_utf8.c +++ b/test/test_utf8.c @@ -1,6 +1,6 @@ /* * test_utf8.c - * Copyright (c) 2019-2021 K.Kosako + * Copyright (c) 2019-2022 K.Kosako */ #ifdef ONIG_ESCAPE_UCHAR_COLLISION #undef ONIG_ESCAPE_UCHAR_COLLISION @@ -699,6 +699,8 @@ extern int main(int argc, char* argv[]) x2("(?:(?)|(?efg))\\k", "", 0, 0); x2("(?:(?abc)|(?efg))\\k", "abcefgefg", 3, 9); n("(?:(?abc)|(?efg))\\k", "abcefg"); + x2("(?x)(?xx)\\k", "xxxx", 0, 4); + x2("(?x)(?xx)\\k", "xxxxz", 0, 4); x2("(?:(?.)|(?..)|(?...)|(?....)|(?.....)|(?......)|(?.......)|(?........)|(?.........)|(?..........)|(?...........)|(?............)|(?.............)|(?..............))\\k$", "a-pyumpyum", 2, 10); x3("(?:(?.)|(?..)|(?...)|(?....)|(?.....)|(?......)|(?.......)|(?........)|(?.........)|(?..........)|(?...........)|(?............)|(?.............)|(?..............))\\k$", "xxxxabcdefghijklmnabcdefghijklmn", 4, 18, 14); x3("(?)(?)(?)(?)(?)(?)(?)(?)(?)(?)(?)(?)(?)(?)(?)(?aaa)(?)$", "aaa", 0, 3, 16); @@ -1597,6 +1599,37 @@ extern int main(int argc, char* argv[]) x2("[\\W\\x{0063 0071}]+", "*cqa", 0, 3); x2("(\\O|(?=z\\g<2>*))(\\g<0>){0}", "a", 0, 1); + /* whole options */ + x2("(?Ii)abc", "abc", 0, 3); + x2("(?Ii)abc", "ABC", 0, 3); + x2("(?Ii:abc)", "abc", 0, 3); + x2("(?Ii)xyz|abc", "aBc", 0, 3); + x2("(?Ii:zz|abc|AZ)", "ABc", 0, 3); + e("(?Ii:abc)d", "abc", ONIGERR_INVALID_GROUP_OPTION); + e("(?-Ii:abc)", "abc", ONIGERR_INVALID_GROUP_OPTION); + x2("(?I-i:abc)", "abc", 0, 3); + e("(?i-I:abc)", "abc", ONIGERR_INVALID_GROUP_OPTION); + x2("(?i)\xe2\x84\xaa", "k", 0, 1); + n("(?Ii)\xe2\x84\xaa", "k"); + e("((?Ii)abc)", "", ONIGERR_INVALID_GROUP_OPTION); + x2("(?:(?Ii)abc)", "ABC", 0, 3); + x2("(?:(?:(?Ii)abc))", "ABC", 0, 3); + e("x(?Ii)", "", ONIGERR_INVALID_GROUP_OPTION); + e("()(?Ii)", "", ONIGERR_INVALID_GROUP_OPTION); + e("(?:)(?Ii)", "", ONIGERR_INVALID_GROUP_OPTION); + e("^(?Ii)", "", ONIGERR_INVALID_GROUP_OPTION); + e("(?Ii)$", "", ONIGERR_INVALID_GROUP_OPTION); + e("(?Ii)|", "", ONIGERR_INVALID_GROUP_OPTION); + e("(?Ii)|(?Ii)", "", ONIGERR_INVALID_GROUP_OPTION); + x2("a*", "aabcaaa", 0, 2); + x2("(?L)a*", "aabcaaa", 4, 7); + e("x(?L)xxxxx", "", ONIGERR_INVALID_GROUP_OPTION); + e("(?-L)x", "", ONIGERR_INVALID_GROUP_OPTION); + x3("(..)\\1", "abab", 0, 2, 1); + e("(?C)(..)\\1", "abab", ONIGERR_INVALID_BACKREF); + e("(?-C)", "", ONIGERR_INVALID_GROUP_OPTION); + e("(?C)(.)(.)(.)(?.)\\1", "abcdd", ONIGERR_NUMBERED_BACKREF_OR_CALL_NOT_ALLOWED); + n("a(b|)+d", "abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcd"); /* https://www.haijin-boys.com/discussions/5079 */ n(" \xfd", ""); /* https://bugs.php.net/bug.php?id=77370 */ /* can't use \xfc00.. because compiler error: hex escape sequence out of range */ -- cgit v1.2.3