summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-bugs/strops5_bug.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2020-11-01 18:47:24 +0100
committerDenys Vlasenko2020-11-01 18:47:24 +0100
commit64981b4c8e88812c322bee3832f1d421ff670ed5 (patch)
treed006cbaab733a481ce753a3f900980a78e85badc /shell/hush_test/hush-bugs/strops5_bug.tests
parenta7c065354f820560621aa5f2e90498d6636f41c3 (diff)
downloadbusybox-64981b4c8e88812c322bee3832f1d421ff670ed5.zip
busybox-64981b4c8e88812c322bee3832f1d421ff670ed5.tar.gz
hush: document bugs in [[ =~ ]] comparison
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-bugs/strops5_bug.tests')
-rwxr-xr-xshell/hush_test/hush-bugs/strops5_bug.tests10
1 files changed, 10 insertions, 0 deletions
diff --git a/shell/hush_test/hush-bugs/strops5_bug.tests b/shell/hush_test/hush-bugs/strops5_bug.tests
new file mode 100755
index 0000000..3e24df7
--- /dev/null
+++ b/shell/hush_test/hush-bugs/strops5_bug.tests
@@ -0,0 +1,10 @@
+v='*.z'
+
+# Buggy:
+# the problem is that expansion rules of LHS and RHS of ~=
+# should not be the same: in RHS, "$v" and "*" should escape metas
+# (currently "$v" does not),
+# but in LHS, they should _not_ do that
+# (currently "*" does). Thus these cases fail:
+[[ a.z == "$v" ]]; echo 4:no:$? # BUG: "$v" expands to *.z
+[[ "*".z == ?.z ]]; echo 5:YES:$? # BUG: "*" expands to \*