From: K.Kosako Date: Thu, 8 Mar 2018 05:48:22 +0000 (+0900) Subject: add test cases for abrreviation notation of callouts in condition X-Git-Tag: v6.8.0~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93d7c35ee746eeebfa94e65d89e7d9b8cf966d79;p=onig add test cases for abrreviation notation of callouts in condition --- 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();