diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-10-20 19:39:57 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-10-21 11:50:52 +0300 |
commit | 4881a227779a78db1de2a7723e2a86f2b61453b3 (patch) | |
tree | c85ca613cc1a9dc4952d0cc7b0c55603f2b4edfa /tests/test/script/runner/for.testscript | |
parent | e5efed8e25180b9d009edf2a06e5151db107e883 (diff) |
Change attribute syntax in script to come after variable in set and for (set x [...], for x [...])
Diffstat (limited to 'tests/test/script/runner/for.testscript')
-rw-r--r-- | tests/test/script/runner/for.testscript | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/tests/test/script/runner/for.testscript b/tests/test/script/runner/for.testscript index 658ff49..765b978 100644 --- a/tests/test/script/runner/for.testscript +++ b/tests/test/script/runner/for.testscript @@ -33,11 +33,11 @@ : special-var : $c <<EOI && $b 2>>EOE != 0 - for *: -a -b - echo $* >| + for ~: -a -b + echo $~ >| end EOI - testscript:1:5: error: attempt to set '*' variable directly + testscript:1:5: error: attempt to set '~' variable directly EOE : exit @@ -109,7 +109,7 @@ : typed : $c <<EOI && $b >>/EOO - echo "a b" | for -w [dir_path] x + echo "a b" | for -w x [dir_path] echo $x >| end EOI @@ -208,24 +208,49 @@ : special-var : $c <<EOI && $b 2>>EOE != 0 - echo "a b" | for -w * + echo "a b" | for -w ~ echo $* >| end EOI - testscript:1:1: error: attempt to set '*' variable directly + testscript:1:1: error: attempt to set '~' variable directly info: test id: 1 EOE - : misuse + : unsep-attrs : $c <<EOI && $b 2>>EOE != 0 - echo "a b" | for v: - echo $v >| + echo "a b" | for -w x[string] + echo $x >| end EOI - testscript:1:19: error: expected newline instead of ':' + testscript:1:1: error: for: expected variable name instead of x[string] + info: test id: 1 EOE + : misuse + : + { + : after-var + : + $c <<EOI && $b 2>>EOE != 0 + echo "a b" | for v: + echo $v >| + end + EOI + testscript:1:19: error: expected newline instead of ':' + EOE + + : after-attrs + : + $c <<EOI && $b 2>>EOE != 0 + echo "a b" | for v [string]: + echo $v >| + end + EOI + testscript:1:28: error: expected newline instead of ':' + EOE + } + : exit : $c <<EOI && $b >>EOO @@ -343,7 +368,7 @@ : typed : $c <<EOI && $b >>/EOO - for -w [dir_path] x <"a b" + for -w x [dir_path] <"a b" echo $x >| end EOI @@ -354,7 +379,7 @@ : typed-no-ops : $c <<EOI && $b >>/EOO - for [dir_path] x <"a b" + for x [dir_path] <"a b" echo $x >| end EOI @@ -443,11 +468,11 @@ : special-var : $c <<EOI && $b 2>>EOE != 0 - for * <"a b" - echo $* >| + for ~ <"a b" + echo $~ >| end EOI - testscript:1:5: error: attempt to set '*' variable directly + testscript:1:5: error: attempt to set '~' variable directly EOE : exit |