summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-quoting
diff options
context:
space:
mode:
authorDenys Vlasenko2018-07-20 16:18:59 +0200
committerDenys Vlasenko2018-07-20 16:29:43 +0200
commit294eb4612cd668521faa48711297196f00af61d9 (patch)
tree15b002f51fdbfc3d32b1c33b8dd886d791f70cbc /shell/hush_test/hush-quoting
parent57235beb696a7dbdb48751b9721c4c025127ae96 (diff)
downloadbusybox-294eb4612cd668521faa48711297196f00af61d9.zip
busybox-294eb4612cd668521faa48711297196f00af61d9.tar.gz
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/hush_test/hush-quoting')
-rw-r--r--shell/hush_test/hush-quoting/dollar_altvalue9.right24
-rwxr-xr-xshell/hush_test/hush-quoting/dollar_altvalue9.tests17
2 files changed, 41 insertions, 0 deletions
diff --git a/shell/hush_test/hush-quoting/dollar_altvalue9.right b/shell/hush_test/hush-quoting/dollar_altvalue9.right
new file mode 100644
index 0000000..fc6c269
--- /dev/null
+++ b/shell/hush_test/hush-quoting/dollar_altvalue9.right
@@ -0,0 +1,24 @@
+Unquoted 1:
+|a|
+|x y|
+|1|
+|2|
+|1 2|
+|A|
+|B|
+|C D|
+|zb|
+Quoted 1:
+|a 'x y' 1 2 '' 1 2 A B C D zb|
+Unquoted 2:
+|ax y|
+|1|
+|2|
+|1 2|
+|A|
+|B|
+|C D|
+|z|
+|b|
+Quoted 2:
+|a 'x y' 1 2 '' 1 2 A B C D z b|
diff --git a/shell/hush_test/hush-quoting/dollar_altvalue9.tests b/shell/hush_test/hush-quoting/dollar_altvalue9.tests
new file mode 100755
index 0000000..27a6f4f
--- /dev/null
+++ b/shell/hush_test/hush-quoting/dollar_altvalue9.tests
@@ -0,0 +1,17 @@
+f() { for i; do echo "|$i|"; done; }
+
+echo Unquoted 1:
+x='1 2'; f a${x:+ 'x y' $x '' "$x" `echo A B` "`echo C D`" z}b
+echo Quoted 1:
+x='1 2'; f "a${x:+ 'x y' $x '' "$x" `echo A B` "`echo C D`" z}b"
+
+echo Unquoted 2:
+x='1 2'; f a${x:+'x y' $x '' "$x" `echo A B` "`echo C D`" z }b
+echo Quoted 2:
+x='1 2'; f "a${x:+ 'x y' $x '' "$x" `echo A B` "`echo C D`" z }b"
+
+#echo Unquoted 3:
+#e=
+#x='1 2'; f a${x:+'x y' $x '' "$x" $e $e "$e" $e `echo A B` "`echo C D`" z }b
+#echo Quoted 3:
+#x='1 2'; f "a${x:+ 'x y' $x '' "$x" $e $e "$e" $e `echo A B` "`echo C D`" z }b"