aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-07-20 16:18:59 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-07-20 16:29:43 +0200
commit294eb4612cd668521faa48711297196f00af61d9 (patch)
tree15b002f51fdbfc3d32b1c33b8dd886d791f70cbc /shell/ash_test
parent57235beb696a7dbdb48751b9721c4c025127ae96 (diff)
downloadbusybox-w32-294eb4612cd668521faa48711297196f00af61d9.tar.gz
busybox-w32-294eb4612cd668521faa48711297196f00af61d9.tar.bz2
busybox-w32-294eb4612cd668521faa48711297196f00af61d9.zip
hush: fix word splitting in ${v:+ARG} - dollar_altvalue1 test
ash might be a bit buggy, need to investigate dollar_altvalue9 test function old new delta expand_one_var 1639 2236 +597 expand_variables 112 128 +16 expand_vars_to_list 1117 1097 -20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 613/-20) Total: 593 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r--shell/ash_test/ash-quoting/dollar_altvalue9.right24
-rwxr-xr-xshell/ash_test/ash-quoting/dollar_altvalue9.tests17
2 files changed, 41 insertions, 0 deletions
diff --git a/shell/ash_test/ash-quoting/dollar_altvalue9.right b/shell/ash_test/ash-quoting/dollar_altvalue9.right
new file mode 100644
index 000000000..fc6c2697c
--- /dev/null
+++ b/shell/ash_test/ash-quoting/dollar_altvalue9.right
@@ -0,0 +1,24 @@
1Unquoted 1:
2|a|
3|x y|
4|1|
5|2|
6|1 2|
7|A|
8|B|
9|C D|
10|zb|
11Quoted 1:
12|a 'x y' 1 2 '' 1 2 A B C D zb|
13Unquoted 2:
14|ax y|
15|1|
16|2|
17|1 2|
18|A|
19|B|
20|C D|
21|z|
22|b|
23Quoted 2:
24|a 'x y' 1 2 '' 1 2 A B C D z b|
diff --git a/shell/ash_test/ash-quoting/dollar_altvalue9.tests b/shell/ash_test/ash-quoting/dollar_altvalue9.tests
new file mode 100755
index 000000000..27a6f4f3c
--- /dev/null
+++ b/shell/ash_test/ash-quoting/dollar_altvalue9.tests
@@ -0,0 +1,17 @@
1f() { for i; do echo "|$i|"; done; }
2
3echo Unquoted 1:
4x='1 2'; f a${x:+ 'x y' $x '' "$x" `echo A B` "`echo C D`" z}b
5echo Quoted 1:
6x='1 2'; f "a${x:+ 'x y' $x '' "$x" `echo A B` "`echo C D`" z}b"
7
8echo Unquoted 2:
9x='1 2'; f a${x:+'x y' $x '' "$x" `echo A B` "`echo C D`" z }b
10echo Quoted 2:
11x='1 2'; f "a${x:+ 'x y' $x '' "$x" `echo A B` "`echo C D`" z }b"
12
13#echo Unquoted 3:
14#e=
15#x='1 2'; f a${x:+'x y' $x '' "$x" $e $e "$e" $e `echo A B` "`echo C D`" z }b
16#echo Quoted 3:
17#x='1 2'; f "a${x:+ 'x y' $x '' "$x" $e $e "$e" $e `echo A B` "`echo C D`" z }b"