From 27342e7a1066a3f1426a624a35e52c23bdedeed9 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 20 Oct 2022 20:38:40 +0300 Subject: Add support for pairs in script 'for x:...' loop --- tests/recipe/buildscript/testscript | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests') diff --git a/tests/recipe/buildscript/testscript b/tests/recipe/buildscript/testscript index 6d33888..4299fb5 100644 --- a/tests/recipe/buildscript/testscript +++ b/tests/recipe/buildscript/testscript @@ -1101,6 +1101,40 @@ if $posix $* clean 2>- } + : pair + : + { + mkdir -p src/build; + echo 'bar' >=src/bar; + echo 'baz' >=src/baz; + + echo 'project =' >=src/build/bootstrap.build; + + cat <=src/buildfile; + foo: file{bar}@./ file{baz}@./ + {{ + p = $path($>) + rm -f $p + + for f: $< + cat $path($f) >>$p + end + }} + EOI + + $* src/@out/ 2>>/EOE; + mkdir fsdir{out/} + cat out/file{foo} + EOE + + cat <<>EOO; + bar + baz + EOO + + $* 'clean:' src/@out/ 2>- + } + : special-var : { -- cgit v1.1