summaryrefslogtreecommitdiff
path: root/release/src/router/busybox/shell/msh_test/msh-vars
diff options
context:
space:
mode:
Diffstat (limited to 'release/src/router/busybox/shell/msh_test/msh-vars')
-rw-r--r--release/src/router/busybox/shell/msh_test/msh-vars/star.right6
-rwxr-xr-xrelease/src/router/busybox/shell/msh_test/msh-vars/star.tests8
-rw-r--r--release/src/router/busybox/shell/msh_test/msh-vars/var.right4
-rwxr-xr-xrelease/src/router/busybox/shell/msh_test/msh-vars/var.tests9
-rw-r--r--release/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.right40
-rwxr-xr-xrelease/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests40
6 files changed, 107 insertions, 0 deletions
diff --git a/release/src/router/busybox/shell/msh_test/msh-vars/star.right b/release/src/router/busybox/shell/msh_test/msh-vars/star.right
new file mode 100644
index 00000000..0ecc55bc
--- /dev/null
+++ b/release/src/router/busybox/shell/msh_test/msh-vars/star.right
@@ -0,0 +1,6 @@
+.1.
+.abc.
+.d.
+.e.
+.f.
+.1 abc d e f.
diff --git a/release/src/router/busybox/shell/msh_test/msh-vars/star.tests b/release/src/router/busybox/shell/msh_test/msh-vars/star.tests
new file mode 100755
index 00000000..5554c409
--- /dev/null
+++ b/release/src/router/busybox/shell/msh_test/msh-vars/star.tests
@@ -0,0 +1,8 @@
+if test $# = 0; then
+ exec "$THIS_SH" star.tests 1 abc 'd e f'
+fi
+# 'd e f' should be split into 3 separate args:
+for a in $*; do echo ".$a."; done
+
+# must produce .1 abc d e f.
+for a in "$*"; do echo ".$a."; done
diff --git a/release/src/router/busybox/shell/msh_test/msh-vars/var.right b/release/src/router/busybox/shell/msh_test/msh-vars/var.right
new file mode 100644
index 00000000..14b2314d
--- /dev/null
+++ b/release/src/router/busybox/shell/msh_test/msh-vars/var.right
@@ -0,0 +1,4 @@
+http://busybox.net
+http://busybox.net_abc
+1
+1
diff --git a/release/src/router/busybox/shell/msh_test/msh-vars/var.tests b/release/src/router/busybox/shell/msh_test/msh-vars/var.tests
new file mode 100755
index 00000000..0a63696c
--- /dev/null
+++ b/release/src/router/busybox/shell/msh_test/msh-vars/var.tests
@@ -0,0 +1,9 @@
+URL=http://busybox.net
+
+echo $URL
+echo ${URL}_abc
+
+true
+false; echo $?
+true
+{ false; echo $?; }
diff --git a/release/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.right b/release/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.right
new file mode 100644
index 00000000..c8aca1c1
--- /dev/null
+++ b/release/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.right
@@ -0,0 +1,40 @@
+Testing: in x y z
+.x.
+.y.
+.z.
+Testing: in u $empty v
+.u.
+.v.
+Testing: in u " $empty" v
+.u.
+. .
+.v.
+Testing: in u $empty $empty$a v
+.u.
+.a.
+.v.
+Testing: in $a_b
+.a.
+.b.
+Testing: in $*
+.abc.
+.d.
+.e.
+Testing: in $@
+.abc.
+.d.
+.e.
+Testing: in -$*-
+.-abc.
+.d.
+.e-.
+Testing: in -$@-
+.-abc.
+.d.
+.e-.
+Testing: in $a_b -$a_b-
+.a.
+.b.
+.-a.
+.b-.
+Finished
diff --git a/release/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests b/release/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests
new file mode 100755
index 00000000..4d1c1120
--- /dev/null
+++ b/release/src/router/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests
@@ -0,0 +1,40 @@
+if test $# = 0; then
+ exec "$THIS_SH" var_subst_in_for.tests abc "d e"
+fi
+
+echo 'Testing: in x y z'
+for a in x y z; do echo ".$a."; done
+
+echo 'Testing: in u $empty v'
+empty=''
+for a in u $empty v; do echo ".$a."; done
+
+echo 'Testing: in u " $empty" v'
+empty=''
+for a in u " $empty" v; do echo ".$a."; done
+
+echo 'Testing: in u $empty $empty$a v'
+a='a'
+for a in u $empty $empty$a v; do echo ".$a."; done
+
+echo 'Testing: in $a_b'
+a_b='a b'
+for a in $a_b; do echo ".$a."; done
+
+echo 'Testing: in $*'
+for a in $*; do echo ".$a."; done
+
+echo 'Testing: in $@'
+for a in $@; do echo ".$a."; done
+
+echo 'Testing: in -$*-'
+for a in -$*-; do echo ".$a."; done
+
+echo 'Testing: in -$@-'
+for a in -$@-; do echo ".$a."; done
+
+echo 'Testing: in $a_b -$a_b-'
+a_b='a b'
+for a in $a_b -$a_b-; do echo ".$a."; done
+
+echo Finished