aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-21 15:24:12 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-21 15:24:12 +0200
commit73e013fca7afd2edc9ba8530df77c8210a14700b (patch)
treecee35b3493f12565fd20100be1ea2da4a6a86baf /shell/hush_test
parenta88585a931c7e81d4d3d393127d8ad8c0fe73fb5 (diff)
downloadbusybox-w32-73e013fca7afd2edc9ba8530df77c8210a14700b.tar.gz
busybox-w32-73e013fca7afd2edc9ba8530df77c8210a14700b.tar.bz2
busybox-w32-73e013fca7afd2edc9ba8530df77c8210a14700b.zip
hush: handle ${var:NUM:} too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-vars/param_expand_bash_substring.right12
-rwxr-xr-xshell/hush_test/hush-vars/param_expand_bash_substring.tests12
2 files changed, 24 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/param_expand_bash_substring.right b/shell/hush_test/hush-vars/param_expand_bash_substring.right
index 9cd465938..6e3eb3ba6 100644
--- a/shell/hush_test/hush-vars/param_expand_bash_substring.right
+++ b/shell/hush_test/hush-vars/param_expand_bash_substring.right
@@ -7,23 +7,35 @@ hush: syntax error: unterminated ${name}
71:1 =|| 71:1 =||
81:1:2=|| 81:1:2=||
91::2 =|| 91::2 =||
101:1: =||
111:: =||
101 =|0123| 121 =|0123|
111:1 =|123| 131:1 =|123|
121:1:2=|12| 141:1:2=|12|
131::2 =|01| 151::2 =|01|
161:1: =||
171:: =||
14f =|| 18f =||
15f:1 =|| 19f:1 =||
16f:1:2=|| 20f:1:2=||
17f::2 =|| 21f::2 =||
22f:1: =||
23f:: =||
18f =|| 24f =||
19f:1 =|| 25f:1 =||
20f:1:2=|| 26f:1:2=||
21f::2 =|| 27f::2 =||
28f:1: =||
29f:: =||
22f =|a| 30f =|a|
23f:1 =|| 31f:1 =||
24f:1:2=|| 32f:1:2=||
25f::2 =|a| 33f::2 =|a|
34f:1: =||
35f:: =||
26f =|0123456789| 36f =|0123456789|
27f:1 =|123456789| 37f:1 =|123456789|
28f:1:2=|12| 38f:1:2=|12|
29f::2 =|01| 39f::2 =|01|
40f:1: =||
41f:: =||
diff --git a/shell/hush_test/hush-vars/param_expand_bash_substring.tests b/shell/hush_test/hush-vars/param_expand_bash_substring.tests
index 6a1765559..eedd435ed 100755
--- a/shell/hush_test/hush-vars/param_expand_bash_substring.tests
+++ b/shell/hush_test/hush-vars/param_expand_bash_substring.tests
@@ -19,28 +19,40 @@ export var=0123456789
19"$THIS_SH" -c 'set --; echo "1:1 =|${1:1}|"' 19"$THIS_SH" -c 'set --; echo "1:1 =|${1:1}|"'
20"$THIS_SH" -c 'set --; echo "1:1:2=|${1:1:2}|"' 20"$THIS_SH" -c 'set --; echo "1:1:2=|${1:1:2}|"'
21"$THIS_SH" -c 'set --; echo "1::2 =|${1::2}|"' 21"$THIS_SH" -c 'set --; echo "1::2 =|${1::2}|"'
22"$THIS_SH" -c 'set --; echo "1:1: =|${1:1:}|"'
23"$THIS_SH" -c 'set --; echo "1:: =|${1::}|"'
22 24
23"$THIS_SH" -c 'set -- 0123; echo "1 =|${1}|"' 25"$THIS_SH" -c 'set -- 0123; echo "1 =|${1}|"'
24"$THIS_SH" -c 'set -- 0123; echo "1:1 =|${1:1}|"' 26"$THIS_SH" -c 'set -- 0123; echo "1:1 =|${1:1}|"'
25"$THIS_SH" -c 'set -- 0123; echo "1:1:2=|${1:1:2}|"' 27"$THIS_SH" -c 'set -- 0123; echo "1:1:2=|${1:1:2}|"'
26"$THIS_SH" -c 'set -- 0123; echo "1::2 =|${1::2}|"' 28"$THIS_SH" -c 'set -- 0123; echo "1::2 =|${1::2}|"'
29"$THIS_SH" -c 'set -- 0123; echo "1:1: =|${1:1:}|"'
30"$THIS_SH" -c 'set -- 0123; echo "1:: =|${1::}|"'
27 31
28"$THIS_SH" -c 'unset f; echo "f =|$f|"' 32"$THIS_SH" -c 'unset f; echo "f =|$f|"'
29"$THIS_SH" -c 'unset f; echo "f:1 =|${f:1}|"' 33"$THIS_SH" -c 'unset f; echo "f:1 =|${f:1}|"'
30"$THIS_SH" -c 'unset f; echo "f:1:2=|${f:1:2}|"' 34"$THIS_SH" -c 'unset f; echo "f:1:2=|${f:1:2}|"'
31"$THIS_SH" -c 'unset f; echo "f::2 =|${f::2}|"' 35"$THIS_SH" -c 'unset f; echo "f::2 =|${f::2}|"'
36"$THIS_SH" -c 'unset f; echo "f:1: =|${f:1:}|"'
37"$THIS_SH" -c 'unset f; echo "f:: =|${f::}|"'
32 38
33"$THIS_SH" -c 'f=; echo "f =|$f|"' 39"$THIS_SH" -c 'f=; echo "f =|$f|"'
34"$THIS_SH" -c 'f=; echo "f:1 =|${f:1}|"' 40"$THIS_SH" -c 'f=; echo "f:1 =|${f:1}|"'
35"$THIS_SH" -c 'f=; echo "f:1:2=|${f:1:2}|"' 41"$THIS_SH" -c 'f=; echo "f:1:2=|${f:1:2}|"'
36"$THIS_SH" -c 'f=; echo "f::2 =|${f::2}|"' 42"$THIS_SH" -c 'f=; echo "f::2 =|${f::2}|"'
43"$THIS_SH" -c 'f=; echo "f:1: =|${f:1:}|"'
44"$THIS_SH" -c 'f=; echo "f:: =|${f::}|"'
37 45
38"$THIS_SH" -c 'f=a; echo "f =|$f|"' 46"$THIS_SH" -c 'f=a; echo "f =|$f|"'
39"$THIS_SH" -c 'f=a; echo "f:1 =|${f:1}|"' 47"$THIS_SH" -c 'f=a; echo "f:1 =|${f:1}|"'
40"$THIS_SH" -c 'f=a; echo "f:1:2=|${f:1:2}|"' 48"$THIS_SH" -c 'f=a; echo "f:1:2=|${f:1:2}|"'
41"$THIS_SH" -c 'f=a; echo "f::2 =|${f::2}|"' 49"$THIS_SH" -c 'f=a; echo "f::2 =|${f::2}|"'
50"$THIS_SH" -c 'f=a; echo "f:1: =|${f:1:}|"'
51"$THIS_SH" -c 'f=a; echo "f:: =|${f::}|"'
42 52
43"$THIS_SH" -c 'f=0123456789; echo "f =|$f|"' 53"$THIS_SH" -c 'f=0123456789; echo "f =|$f|"'
44"$THIS_SH" -c 'f=0123456789; echo "f:1 =|${f:1}|"' 54"$THIS_SH" -c 'f=0123456789; echo "f:1 =|${f:1}|"'
45"$THIS_SH" -c 'f=0123456789; echo "f:1:2=|${f:1:2}|"' 55"$THIS_SH" -c 'f=0123456789; echo "f:1:2=|${f:1:2}|"'
46"$THIS_SH" -c 'f=0123456789; echo "f::2 =|${f::2}|"' 56"$THIS_SH" -c 'f=0123456789; echo "f::2 =|${f::2}|"'
57"$THIS_SH" -c 'f=0123456789; echo "f:1: =|${f:1:}|"'
58"$THIS_SH" -c 'f=0123456789; echo "f:: =|${f::}|"'