aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/sh.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/sh.test b/tests/sh.test
index 429b7706..7bab1a60 100644
--- a/tests/sh.test
+++ b/tests/sh.test
@@ -73,6 +73,7 @@ testing 'default exports' \
export EVAL="$SH -c"
testing "smoketest" "echo hello" "hello\n" "" ""
+testing "line break" $'ec\\\nho hello' 'hello\n' '' ''
testing "eval" "eval echo hello" "hello\n" "" ""
testing "eval2" "eval 'echo hello'; echo $?" "hello\n0\n" "" ""
testing "eval3" 'X="echo hello"; eval "$X"' "hello\n" "" ""
@@ -311,6 +312,12 @@ testing '$LINENO 2' $'echo $LINENO\necho $LINENO' '0\n1\n' '' ''
testing '$EUID' 'echo $EUID' "$(id -u)\n" '' ''
testing '$UID' 'echo $UID' "$(id -ur)\n" '' ''
+testing 'readonly for' \
+ 'readonly i; for i in one two three; do echo $i; done 2>/dev/null; echo $?' \
+ '1\n' '' ''
+testing 'readonly {}<' \
+ 'readonly i; echo hello 2>/dev/null {i}</dev/null; echo $?' '1\n' '' ''
+
testing '$_ 1' 'echo walrus; echo $_' 'walrus\nwalrus\n' '' ''
testing '$_ 2' 'unset _; echo $_' '_\n' '' ''