aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK.Kosako <kosako@sofnec.co.jp>2020-01-15 15:38:58 +0900
committerK.Kosako <kosako@sofnec.co.jp>2020-01-15 15:38:58 +0900
commitc83cbd986c92b0e1c1273d0684626cfa0283c0b6 (patch)
tree6ed3565e691665b3935c6ea1144a4fc985a17be1
parent3ce3092dcbac9379d4943bf017e18fd9219ae538 (diff)
downloadoniguruma-c83cbd986c92b0e1c1273d0684626cfa0283c0b6.zip
oniguruma-c83cbd986c92b0e1c1273d0684626cfa0283c0b6.tar.gz
oniguruma-c83cbd986c92b0e1c1273d0684626cfa0283c0b6.tar.bz2
add some test cases
-rw-r--r--test/test_syntax.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_syntax.c b/test/test_syntax.c
index a177e8f..b4b8dc9 100644
--- a/test/test_syntax.c
+++ b/test/test_syntax.c
@@ -177,6 +177,11 @@ static int test_look_behind()
x2("(?<=a|b)c", "abc", 2, 3);
x2("(?<=a|(.))\\1", "abcc", 3, 4);
+ // following is not match in Perl and Java
+ //x2("(?<=a|(.))\\1", "aa", 1, 2);
+
+ n("(?<!c|c)a", "ca");
+
return 0;
}
@@ -196,6 +201,7 @@ extern int main(int argc, char* argv[])
test_isolated_option();
test_prec_read();
test_look_behind();
+ e("(?<=ab|(.))\\1", "abb", ONIGERR_INVALID_LOOK_BEHIND_PATTERN); // Variable length lookbehind not implemented in Perl 5.26.1
x3("()", "abc", 0, 0, 1);
e("(", "", ONIGERR_END_PATTERN_WITH_UNMATCHED_PARENTHESIS);
@@ -205,7 +211,9 @@ extern int main(int argc, char* argv[])
Syntax = ONIG_SYNTAX_JAVA;
test_isolated_option();
-
+ test_prec_read();
+ test_look_behind();
+ x2("(?<=ab|(.))\\1", "abb", 2, 3);
fprintf(stdout,
"\nRESULT SUCC: %4d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",