From 79c2d3a08a673328401df6790a092cea1cfe7163 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 14 Sep 2020 06:25:50 -0500 Subject: Fix multiline case/esac parsing, make syntax_err() exit non-interactve contexts like scripts, and tweak debug scaffolding. --- tests/sh.test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/sh.test') 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 -- cgit v1.2.3