diff options
Diffstat (limited to 'test/test_back.c')
-rw-r--r-- | test/test_back.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test_back.c b/test/test_back.c index 9a6e4a8..52f2e58 100644 --- a/test/test_back.c +++ b/test/test_back.c @@ -1,6 +1,6 @@ /* * test_back.c - * Copyright (c) 2020-2021 K.Kosako + * Copyright (c) 2020-2024 K.Kosako */ #ifdef ONIG_ESCAPE_UCHAR_COLLISION #undef ONIG_ESCAPE_UCHAR_COLLISION @@ -64,7 +64,7 @@ static void xx(char* pattern, char* str, int from, int to, int mem, int not, r = onig_search(reg, (UChar* )str, (UChar* )(str + SLEN(str)), (UChar* )(str + SLEN(str)), (UChar* )str, region, ONIG_OPTION_NONE); - if (r < ONIG_MISMATCH) { + if (r < ONIG_MISMATCH || error_no < ONIG_MISMATCH) { char s[ONIG_MAX_ERROR_MESSAGE_LEN]; if (error_no == 0) { @@ -609,7 +609,7 @@ extern int main(int argc, char* argv[]) n("\\A(a|b\\g<1>c)\\k<1+3>\\z", "bbaccb"); x2("(?i)\\A(a|b\\g<1>c)\\k<1+2>\\z", "bBACcbac", 0, 8); x2("(?i)(?<X>aa)|(?<X>bb)\\k<X>", "BBbb", 0, 4); - x2("(?:\\k'+1'B|(A)C)*", "ACAB", 4, 4); // relative backref by postitive number + x2("(?:\\k'+1'B|(A)C)*", "ACAB", 4, 4); // relative backref by positive number x2("\\g<+2>(abc)(ABC){0}", "ABCabc", 0, 6); // relative call by positive number x2("A\\g'0'|B()", "AAAAB", 4, 5); x3("(A\\g'0')|B", "AAAAB", -1, -1, 1); |