diff options
Diffstat (limited to 'Test/A01grammar.ztst')
-rw-r--r-- | Test/A01grammar.ztst | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst index 88fc8606e..d57085798 100644 --- a/Test/A01grammar.ztst +++ b/Test/A01grammar.ztst @@ -922,7 +922,7 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci x=1 x=2 | echo $x echo $x -0:Assignment-only current shell commands in LHS of pipelin +0:Assignment-only current shell commands in LHS of pipeline >1 >1 @@ -944,3 +944,77 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci if : ${(e)a}; then echo x; fi 1:Status on bad substitution in if without else ?(eval):2: bad substitution + + echo 'echo foo # comment + echo $( + echo bar # comment + )' >source_comments.zsh + $ZTST_testdir/../Src/zsh -f -o extendedglob -is -c '. ./source_comments.zsh' +0:Comments should be handled in command subst in interactively sourced files +>foo +>bar + + function 'ls,/' () {echo success} + {ls,/} +0:workers/47599: current-shell blocks masquerading as brace expansion +>success +F:This test was written to ensure the behaviour doesn't change silently. +F:If this test fails during development, it *might* be appropriate to change +F:its expectations. + + ( + export VALUE=first + print -l 'echo Value is $VALUE' 'VALUE=second sh' 'echo Value is $VALUE' | + $ZTST_testdir/../Src/zsh -f + ) +0:Non-interactive shell command input is line buffered +>Value is first +>Value is second + + fn() { + ! false + } +0:! inverts the status of implicit return + + fn () { + false + ! return + } + fn +1:! does not affect return status of explicit return + + msg=unset + for x in 1 2 3 4 5; do + continue && msg=set && print Not executed + print Not executed, neither. + done + print $msg +0:continue causes immediate continuation +>unset + + msg=unset + () { + return && msg=set && print Not executed + print Not executed, not nor neither. + } + print $msg +0:return causes immediate return +>unset + + msg=unset + for x in 1 2 3 4 5; do + ! continue || msg=set && print Not executed + print Not executed, neither. + done + print $msg +0:! continue causes immediate continuation +>unset + + msg=unset + () { + ! return || msg=set && print Not executed + print Not executed, not nor neither. + } + print $msg +0:! return causes immediate return +>unset |