diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-07-18 12:34:52 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-07-18 12:54:55 +0300 |
commit | 47d5b304235c5b1f409b01cab95a2191eac5a230 (patch) | |
tree | dc82e4971e7c0124a5953b6ab75ec017c6124c83 /tests/function/regex/testscript | |
parent | ef81695c5fa356529bac6f8aa7d9bfe1f1c84473 (diff) |
Add $regex.find_match() and $regex.find_search() functions
Diffstat (limited to 'tests/function/regex/testscript')
-rw-r--r-- | tests/function/regex/testscript | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/function/regex/testscript b/tests/function/regex/testscript index 95dfbb8..5167390 100644 --- a/tests/function/regex/testscript +++ b/tests/function/regex/testscript @@ -436,6 +436,90 @@ EOI } +: find-match +: +{ + : match + : + { + : string + : + $* <<EOI >'true' + print $regex.find_match(-g -O3, [string] '-O[23]') + EOI + + : untyped + : + $* <<EOI >'true' + print $regex.find_match(-g -O3, '-O[23]') + EOI + + : strings + : + $* <<EOI >'true' + print $regex.find_match([strings] -g -O3, '-O[23]') + EOI + + : nomatch + : + $* <<EOI >'false' + print $regex.find_match(-g -O1, '-O[23]') + EOI + } + + : flags + : + { + : icase + : + $* <<EOI >'true' + print $regex.find_match(Foo.cxx, 'f[^.]+.*', icase) + EOI + } +} + +: find-search +: +{ + : match + : + { + : string + : + $* <<EOI >'true' + print $regex.find_search(-g -O3, [string] '-O') + EOI + + : untyped + : + $* <<EOI >'true' + print $regex.find_search(-g -O3, '-O') + EOI + + : strings + : + $* <<EOI >'true' + print $regex.find_search([strings] -g -O3, '-O') + EOI + + : nomatch + : + $* <<EOI >'false' + print $regex.find_search(-g, '-O') + EOI + } + + : flags + : + { + : icase + : + $* <<EOI >'true' + print $regex.find_search(Foo.cxx, 'f', icase) + EOI + } +} + : merge : { |