From f59d82eb8fda3ddcf790556c6c3615e40ae8b15b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 3 Oct 2022 21:23:22 +0300 Subject: Add support for 'for' loop second (... | for x) and third (for x <...) forms in script --- tests/test/script/runner/set.testscript | 195 ++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) (limited to 'tests/test/script/runner/set.testscript') diff --git a/tests/test/script/runner/set.testscript b/tests/test/script/runner/set.testscript index b2944a3..b4c8089 100644 --- a/tests/test/script/runner/set.testscript +++ b/tests/test/script/runner/set.testscript @@ -343,6 +343,201 @@ EOE EOI } + + : split + : + : Test various splitting modes as above, but now reading the stream in the + : non-blocking mode. + : + { + : whitespace-separated-list + : + { + : non-exact + : + { + : non-empty + : + $c <'"foo" "bar"' + EOI + + : empty + : + $c <'' + EOI + + : spaces + : + $c <'' + EOI + } + + : exact + : + { + : trailing-ws + : + $c <'"foo" "bar" ""' + EOI + + : no-trailing-ws + : + : Note that we need to strip the default trailing newline as well with the + : ':' modifier. + : + $c <'"foo" "bar"' + EOI + + : empty + : + $c <'' + EOI + + : spaces + : + $c <'""' + EOI + } + } + + : newline-separated-list + : + { + : non-exact + : + $c <'"" "foo" "" "bar" ""' + EOI + + : exact + : + { + : trailing-newline + : + $c <'"" "foo" "" "bar" "" ""' + EOI + + : no-trailing-newline + : + $c <'"" "foo" "" "bar"' + EOI + } + } + + : string + : + { + : non-exact + : + $c <>EOO + + foo + + bar + + EOO + EOI + + : exact + : + : Note that echo adds the trailing newline, so EOF and EOO here-documents + : differ by this newline. + : + { + : trailing-newline + : + $c <>EOO + + foo + + bar + + EOO + EOI + + : no-trailing-newline + : + $c <>EOO + + foo + + bar + EOO + EOI + } + } + } } : attributes -- cgit v1.1