From bc6ce6628c2517aa419b5551b8d378da794b84f2 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 26 May 2020 05:16:44 -0500 Subject: More sh tests. --- tests/sh.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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}