From 93d7c35ee746eeebfa94e65d89e7d9b8cf966d79 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Thu, 8 Mar 2018 14:48:22 +0900 Subject: [PATCH] add test cases for abrreviation notation of callouts in condition --- sample/callout.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sample/callout.c b/sample/callout.c index 012f00a..25dffb1 100644 --- a/sample/callout.c +++ b/sample/callout.c @@ -229,14 +229,13 @@ extern int main(int argc, char* argv[]) (void)onig_set_callout_of_contents(progress_callout_func); (void)onig_set_retraction_callout_of_contents(retraction_callout_func); - // callout of contents + /* callout of contents */ test(enc, "a+(?{foo bar baz...}X)$", "aaab"); test(enc, "(?{{!{}#$%&'()=-~^|[_]`@*:+;<>?/.\\,}}[symbols])c", "abc"); test(enc, "\\A(...)(?{{{booooooooooooo{{ooo}}ooooooooooz}}}<)", "aaab"); test(enc, "\\A(?!a(?{in prec-read-not}[xxx]X)b)", "ac"); test(enc, "(?=,4})", "abababcabababaa"); + /* callouts in condition */ + test(enc, "\\A(?(?{in condition})then|else)\\z", "then"); + test(enc, "\\A(?(*FAIL)then|else)\\z", "else"); + /* monitor test */ - //test(enc, "(?:(*MON)(*MAX{3})a(*MON{foo})|(*MAX{4})b)*", "bbbaabbab"); test(enc, "(?:(*MON{X})(*FAIL)|.{,3}(*MON[FOO])k)", "abcdefghijk"); onig_end(); -- 2.40.0