diff options
author | Denys Vlasenko | 2010-05-21 15:24:12 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-05-21 15:24:12 +0200 |
commit | 73e013fca7afd2edc9ba8530df77c8210a14700b (patch) | |
tree | cee35b3493f12565fd20100be1ea2da4a6a86baf /shell/hush_test/hush-vars | |
parent | a88585a931c7e81d4d3d393127d8ad8c0fe73fb5 (diff) | |
download | busybox-73e013fca7afd2edc9ba8530df77c8210a14700b.zip busybox-73e013fca7afd2edc9ba8530df77c8210a14700b.tar.gz |
hush: handle ${var:NUM:} too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-vars')
-rw-r--r-- | shell/hush_test/hush-vars/param_expand_bash_substring.right | 12 | ||||
-rwxr-xr-x | shell/hush_test/hush-vars/param_expand_bash_substring.tests | 12 |
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 9cd4659..6e3eb3b 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} 1:1 =|| 1:1:2=|| 1::2 =|| +1:1: =|| +1:: =|| 1 =|0123| 1:1 =|123| 1:1:2=|12| 1::2 =|01| +1:1: =|| +1:: =|| f =|| f:1 =|| f:1:2=|| f::2 =|| +f:1: =|| +f:: =|| f =|| f:1 =|| f:1:2=|| f::2 =|| +f:1: =|| +f:: =|| f =|a| f:1 =|| f:1:2=|| f::2 =|a| +f:1: =|| +f:: =|| f =|0123456789| f:1 =|123456789| f:1:2=|12| f::2 =|01| +f:1: =|| +f:: =|| 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 6a17655..eedd435 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 "$THIS_SH" -c 'set --; echo "1:1 =|${1:1}|"' "$THIS_SH" -c 'set --; echo "1:1:2=|${1:1:2}|"' "$THIS_SH" -c 'set --; echo "1::2 =|${1::2}|"' +"$THIS_SH" -c 'set --; echo "1:1: =|${1:1:}|"' +"$THIS_SH" -c 'set --; echo "1:: =|${1::}|"' "$THIS_SH" -c 'set -- 0123; echo "1 =|${1}|"' "$THIS_SH" -c 'set -- 0123; echo "1:1 =|${1:1}|"' "$THIS_SH" -c 'set -- 0123; echo "1:1:2=|${1:1:2}|"' "$THIS_SH" -c 'set -- 0123; echo "1::2 =|${1::2}|"' +"$THIS_SH" -c 'set -- 0123; echo "1:1: =|${1:1:}|"' +"$THIS_SH" -c 'set -- 0123; echo "1:: =|${1::}|"' "$THIS_SH" -c 'unset f; echo "f =|$f|"' "$THIS_SH" -c 'unset f; echo "f:1 =|${f:1}|"' "$THIS_SH" -c 'unset f; echo "f:1:2=|${f:1:2}|"' "$THIS_SH" -c 'unset f; echo "f::2 =|${f::2}|"' +"$THIS_SH" -c 'unset f; echo "f:1: =|${f:1:}|"' +"$THIS_SH" -c 'unset f; echo "f:: =|${f::}|"' "$THIS_SH" -c 'f=; echo "f =|$f|"' "$THIS_SH" -c 'f=; echo "f:1 =|${f:1}|"' "$THIS_SH" -c 'f=; echo "f:1:2=|${f:1:2}|"' "$THIS_SH" -c 'f=; echo "f::2 =|${f::2}|"' +"$THIS_SH" -c 'f=; echo "f:1: =|${f:1:}|"' +"$THIS_SH" -c 'f=; echo "f:: =|${f::}|"' "$THIS_SH" -c 'f=a; echo "f =|$f|"' "$THIS_SH" -c 'f=a; echo "f:1 =|${f:1}|"' "$THIS_SH" -c 'f=a; echo "f:1:2=|${f:1:2}|"' "$THIS_SH" -c 'f=a; echo "f::2 =|${f::2}|"' +"$THIS_SH" -c 'f=a; echo "f:1: =|${f:1:}|"' +"$THIS_SH" -c 'f=a; echo "f:: =|${f::}|"' "$THIS_SH" -c 'f=0123456789; echo "f =|$f|"' "$THIS_SH" -c 'f=0123456789; echo "f:1 =|${f:1}|"' "$THIS_SH" -c 'f=0123456789; echo "f:1:2=|${f:1:2}|"' "$THIS_SH" -c 'f=0123456789; echo "f::2 =|${f::2}|"' +"$THIS_SH" -c 'f=0123456789; echo "f:1: =|${f:1:}|"' +"$THIS_SH" -c 'f=0123456789; echo "f:: =|${f::}|"' |