From b408d19f614b47670cd0a0def501266f0d7689b5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 18 Oct 2022 15:13:29 +0300 Subject: Fix unexpected 'unterminated double-quoted sequence' script error --- tests/recipe/buildscript/testscript | 42 +++++++++++++++++++++++++++++++++ tests/test/script/runner/for.testscript | 23 ++++++++++++++++++ 2 files changed, 65 insertions(+) (limited to 'tests') diff --git a/tests/recipe/buildscript/testscript b/tests/recipe/buildscript/testscript index c473b0d..94eb665 100644 --- a/tests/recipe/buildscript/testscript +++ b/tests/recipe/buildscript/testscript @@ -1550,6 +1550,48 @@ if $posix $* clean 2>- } + : quoting + : + { + echo 'bar' >=bar; + echo 'baz' >=baz; + + cat <=buildfile; + foo: bar baz + {{ + n = 'gen' + diag "($n)" ($>) + + p = $path($>) + rm -f $p + + o = -w + for "$o" f <<"EOF" + $path($<) + EOF + cat $f >>$p + end + + o = -n + for "($o)" f <<"EOF" + $path($<) + EOF + echo $f >>$p + end + }} + EOI + + $* 2>'gen file{foo.}'; + + cat <<>~%EOO%; + bar + baz + %.+bar .+baz% + EOO + + $* clean 2>- + } + : special-var : { diff --git a/tests/test/script/runner/for.testscript b/tests/test/script/runner/for.testscript index 85ea765..658ff49 100644 --- a/tests/test/script/runner/for.testscript +++ b/tests/test/script/runner/for.testscript @@ -268,6 +268,29 @@ 'b' EOO + : quoted-opt + : + $c <>EOO + o = -n + for "$o" x <| + end; + for "($o)" x <| + end + EOI + 'a' + 'b' + 'c' + 'd' + EOO + : newline-split : $c <>EOO -- cgit v1.1