aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-02-29 07:35:34 -0600
committerRob Landley <rob@landley.net>2020-02-29 07:35:34 -0600
commit2413bbe99090868340edcf60823fa3be595604e3 (patch)
tree93619f3f8d24a497fb8bdfdc0d4dddbf84036cf3
parent6f0f61ad4430f3df72b118371a8b1643ddb69429 (diff)
downloadtoybox-2413bbe99090868340edcf60823fa3be595604e3.tar.gz
More shell tests.
-rwxr-xr-xtests/sh.test4
1 files changed, 4 insertions, 0 deletions
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...