aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-12-25 22:22:48 -0600
committerRob Landley <rob@landley.net>2020-12-25 22:22:48 -0600
commit390fa7bbf39eaf86d53c6842ad99ed7829a51cf8 (patch)
treee1a5533e61ae4390fcc56525d58f3b1f029b069c /tests
parent3e535f2f31226f225ad4335c678dcd13c6295950 (diff)
downloadtoybox-390fa7bbf39eaf86d53c6842ad99ed7829a51cf8.tar.gz
toysh fixes and tests
Diffstat (limited to 'tests')
-rw-r--r--tests/sh.test5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/sh.test b/tests/sh.test
index 67921c1a..1d021acd 100644
--- a/tests/sh.test
+++ b/tests/sh.test
@@ -107,6 +107,9 @@ testing 'default exports' \
testing "leading assignment fail" \
"{ \$SH -c 'X=\${a?blah} > walroid';ls walroid;} 2>/dev/null" '' '' ''
+testing "lineno" "$SH input" "5 one\n6 one\n5 two\n6 two\n" \
+ '#!/bin/bash\n\nfor i in one two\ndo\n echo $LINENO $i\n echo $LINENO $i\ndone\n' ""
+
#########################################################################
# Change EVAL to call sh -c for us, using "bash" explicitly for the host.
export EVAL="$SH -c"
@@ -191,6 +194,8 @@ testing 'wildcards' 'echo w[v-x]w w[x-v]w abc/*/ghi' \
testing '$(( ) )' 'echo ab$((echo hello) | tr e x)cd' "abhxllocd\n" "" ""
testing '$((x=y)) lifetime' 'a=boing; echo $a $a$((a=4))$a $a' 'boing boing44 4\n' '' ''
+testing 'quote' "echo \"'\"" "'\n" "" ""
+
# Loops and flow control
testing "case" 'for i in A C J B; do case "$i" in A) echo got A ;; B) echo and B ;; C) echo then C ;; *) echo default ;; esac; done' \
"got A\nthen C\ndefault\nand B\n" "" ""