aboutsummaryrefslogtreecommitdiff
path: root/tests/function
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-03 17:36:45 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-03 17:36:45 +0300
commit2b281d5ec758d3bddbf27c4098f0767e2471227a (patch)
tree78eda9c7da62445bda57bfede5bf14d52cf56849 /tests/function
parent0fb42229a5bf13170667701ad6cb468d58348007 (diff)
Skip unmatched lines in $regex.replace_lines() if format_no_copy flag is specified
Diffstat (limited to 'tests/function')
-rw-r--r--tests/function/regex/testscript20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/function/regex/testscript b/tests/function/regex/testscript
index fc7fb92..95dfbb8 100644
--- a/tests/function/regex/testscript
+++ b/tests/function/regex/testscript
@@ -146,6 +146,15 @@
print $regex.replace_lines($v, '(.*)\.cxx', '\1.hxx')
EOI
+ : no-copy
+ :
+ $* <<EOI >'foo.hxx'
+ v = "foo.cxx
+ bar.txt"
+
+ print $regex.replace_lines($v, '(.*)\.cxx', '\1.hxx', format_no_copy)
+ EOI
+
: null-fmt
:
$* <<EOI >'bar.txt'
@@ -173,6 +182,17 @@
bar.txt
EOO
+ : no-copy
+ :
+ $* <<EOI >'bar.hxx'
+ v = "foo.cxx
+ bar.txt"
+
+ print $regex.replace_lines($v, \
+ '(.*)\.txt', '\1.hxx', \
+ format_no_copy return_lines)
+ EOI
+
: null-fmt
:
$* <<EOI >'bar.txt'