summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-glob/glob2.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2015-09-04 03:27:08 +0200
committerDenys Vlasenko2015-09-04 03:27:08 +0200
commit66a781acb9c3a78f3063d1e691a1b18a5f9f68ab (patch)
tree073d09fba413f09923e0ef3e59c4f762771f8842 /shell/ash_test/ash-glob/glob2.tests
parent68acc0f835360d439c65d349812b817b1ce5dc61 (diff)
downloadbusybox-66a781acb9c3a78f3063d1e691a1b18a5f9f68ab.zip
busybox-66a781acb9c3a78f3063d1e691a1b18a5f9f68ab.tar.gz
ash: add tests adapted from hush glob tests. glob2.tests currently fails
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-glob/glob2.tests')
-rwxr-xr-xshell/ash_test/ash-glob/glob2.tests27
1 files changed, 27 insertions, 0 deletions
diff --git a/shell/ash_test/ash-glob/glob2.tests b/shell/ash_test/ash-glob/glob2.tests
new file mode 100755
index 0000000..00618b9
--- /dev/null
+++ b/shell/ash_test/ash-glob/glob2.tests
@@ -0,0 +1,27 @@
+# This test demonstrates that in unquoted $v, backslashes expand by this rule:
+# \z -> \\\z; \<eol> -> \\<eol> (for any z, special or not),
+# and subsequently globbing converts \\ to \ and treats \z as literal z
+# even if it is a special char.
+
+>'Zf'
+>'Z\f'
+ echo 'Expected' 'Actual'
+v='\*'; echo 'Z\* :' Z$v # ash is buggy here: prints 'Z\f'
+ echo 'Z* :' Z\*
+ echo 'Z\f :' Z\\*
+ echo 'Z\* :' Z\\\* # NB! only this matches Z$v output
+echo
+v='\z'; echo 'Z\z :' Z$v
+ echo 'Zz :' Z\z
+ echo 'Z\z :' Z\\z
+ echo 'Z\z :' Z\\\z
+echo
+v='\'; echo 'Z\ :' Z$v
+ echo 'Z\ :' Z\\
+echo
+v='*'; echo 'Z\f Zf :' Z$v
+ echo 'Z\f Zf :' Z*
+echo
+
+rm 'Z\f' 'Zf'
+echo Done: $?