aboutsummaryrefslogtreecommitdiff
path: root/tests/sh.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sh.test')
-rwxr-xr-xtests/sh.test12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/sh.test b/tests/sh.test
index e182a491..ba469e49 100755
--- a/tests/sh.test
+++ b/tests/sh.test
@@ -9,7 +9,9 @@
[ -z "$SH" ] && { [ -z "$TEST_HOST" ] && SH="sh" || export SH="bash" ; }
export EVAL="$SH -c"
-testing "" "echo hello" "hello\n" "" ""
+testing "smoketest" "echo hello" "hello\n" "" ""
+
+# ; | && ||
testing "semicolon" "echo one;echo two" "one\ntwo\n" "" ""
testing "simple pipe" "echo hello | cat" "hello\n" "" ""
testing "&&" "true && echo hello" "hello\n" "" ""
@@ -18,6 +20,14 @@ testing "||" "true || echo hello" "" "" ""
testing "||2" "false || echo hello" "hello\n" "" ""
testing "&& ||" "true && false && potato || echo hello" "hello\n" "" ""
+# redirection
+
+testing "" "cat < input" "hello\n" "hello\n" ""
+testing "" "echo blah >out; cat out" "blah\n" "" ""
+testing "" "touch /not/exist 2>out||grep -o /not/exist out" "/not/exist\n" "" ""
+#testing "" 'echo hello | (read i <input; echo $i; read i; echo $i)' \
+# "there\nhello\n" "there\n" ""
+
testing "tilde expansion" "echo ~" "$HOME\n" "" ""
testing "tilde2" "echo ~/dir" "$HOME/dir\n" "" ""
testing "bracket expansion" \