From 2b281d5ec758d3bddbf27c4098f0767e2471227a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 3 Apr 2020 17:36:45 +0300 Subject: Skip unmatched lines in $regex.replace_lines() if format_no_copy flag is specified --- tests/function/regex/testscript | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/function/regex/testscript') 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 + : + $* <'foo.hxx' + v = "foo.cxx + bar.txt" + + print $regex.replace_lines($v, '(.*)\.cxx', '\1.hxx', format_no_copy) + EOI + : null-fmt : $* <'bar.txt' @@ -173,6 +182,17 @@ bar.txt EOO + : no-copy + : + $* <'bar.hxx' + v = "foo.cxx + bar.txt" + + print $regex.replace_lines($v, \ + '(.*)\.txt', '\1.hxx', \ + format_no_copy return_lines) + EOI + : null-fmt : $* <'bar.txt' -- cgit v1.1