diff options
author | Rob Landley <rob@landley.net> | 2020-09-14 06:25:50 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-09-14 06:25:50 -0500 |
commit | 79c2d3a08a673328401df6790a092cea1cfe7163 (patch) | |
tree | 75cf88b3ecca98dc8f4037af7d61f5d8002d80d1 /tests | |
parent | 5b7cc6d6c2a549188ce652d44b2583c01fb48188 (diff) | |
download | toybox-79c2d3a08a673328401df6790a092cea1cfe7163.tar.gz |
Fix multiline case/esac parsing, make syntax_err() exit non-interactve
contexts like scripts, and tweak debug scaffolding.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sh.test | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/sh.test b/tests/sh.test index de5a433c..1adbd97f 100644 --- a/tests/sh.test +++ b/tests/sh.test @@ -170,6 +170,9 @@ testing '$(( ) )' 'echo ab$((echo hello) | tr e x)cd' "abhxllocd\n" "" "" # Loops and flow control testing "case" 'for i in A C J B; do case "$i" in A) echo got A ;; B) echo and B ;; C) echo then C ;; *) echo default ;; esac; done' \ "got A\nthen C\ndefault\nand B\n" "" "" +testing "case newlines" \ + $'case i\n\nin\n\na) echo one\n\n;;\n\ni)\n\necho two\n\n;;\n\nesac' \ + "two\n" "" "" testing "continue" 'for i in a b c; do for j in d e f; do echo $i $j; continue 2; done; done' \ "a d\nb d\nc d\n" "" "" @@ -481,3 +484,5 @@ shxpect '${a?b} sets err, stops cmdline eval' \ #HISTCMD - history number # #TMOUT - used by read + +# does not match: ./sh -c 'echo {a..Z}' becomes a ` _ ^ ] \ [ Z |