From: K.Kosako Date: Fri, 29 Mar 2019 11:37:22 +0000 (+0900) Subject: add some test cases for {n,m} (n > m) X-Git-Tag: v6.9.2_rc1~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91b202f3e1f6f1eea1161af0b1eaaa72cb390891;p=onig add some test cases for {n,m} (n > m) --- diff --git a/test/test_utf8.c b/test/test_utf8.c index cf5e438..af391ce 100644 --- a/test/test_utf8.c +++ b/test/test_utf8.c @@ -1194,6 +1194,14 @@ extern int main(int argc, char* argv[]) x2("\\g'0'++{,0}?", "abcdefgh", 0, 0); x2("\\g'0'++{,0}b", "abcdefgh", 1, 2); x2("\\g'0'++{,0}?def", "abcdefgh", 3, 6); + n("a{2,3}?", "a"); + n("a{3,2}a", "aaa"); + x2("a{3,2}b", "aaab", 0, 4); + x2("a{3,2}b", "aaaab", 1, 5); + x2("a{3,2}b", "aab", 0, 3); + x2("a{3,2}?", "", 0, 0); /* == (?:a{3,2})?*/ + x2("a{2,3}+a", "aaa", 0, 3); /* == (?:a{2,3})+*/ + e("\\u040", "@", ONIGERR_INVALID_CODE_POINT_VALUE); e("(?\\g)", "zzzz", ONIGERR_NEVER_ENDING_RECURSION);