From 2413bbe99090868340edcf60823fa3be595604e3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 29 Feb 2020 07:35:34 -0600 Subject: More shell tests. --- tests/sh.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sh.test b/tests/sh.test index 6a121ce2..9aefe2f9 100755 --- a/tests/sh.test +++ b/tests/sh.test @@ -144,6 +144,7 @@ testing "! isn't special" "echo !" "!\n" "" "" testing "! by itself" '!; echo $?' "1\n" "" "" testing "! true" '! true; echo $?' "1\n" "" "" testing "! ! true" '! ! true; echo $?' "0\n" "" "" +testing "! syntax err" '! echo 2>/dev/null < doesnotexist; echo $?' "0\n" "" "" # The bash man page doesn't say quote removal here, and yet: testing "case quoting" 'case a in "a") echo hello;; esac' 'hello\n' "" "" @@ -203,6 +204,9 @@ txpect "wait for <(exit)" "$SH" "E$P" "Icat <(echo hello 1>&2)\n" $'Ehello\n' \ #txpect "backtick1" "$SH" "E$P" 'IX=fred; echo `echo $x`'$'\n' 'Ofred'$'\n' "E$P" X0 #txpect "backtick2" "$SH" "E$P" 'IX=fred; echo `x=y; echo $x`' $'Oy\n' "E$P" X0 +txpect '${ with newline' "$SH" "E$P" I'HELLO=abc; echo ${HELLO/b/'$'\n' "E> " \ + I$'}\n' O$'a c\n' X0 + # $@ $* $# $? $- $$ $! $0 # always exported: PWD SHLVL _ # ./bash -c 'echo $_' prints $BASH, but PATH search shows path? Hmmm... -- cgit v1.2.3