summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-test2
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test/hush-test2')
-rw-r--r--shell/hush_test/hush-test2/strops5.right3
-rwxr-xr-xshell/hush_test/hush-test2/strops5.tests13
2 files changed, 16 insertions, 0 deletions
diff --git a/shell/hush_test/hush-test2/strops5.right b/shell/hush_test/hush-test2/strops5.right
new file mode 100644
index 0000000..9ed4d65
--- /dev/null
+++ b/shell/hush_test/hush-test2/strops5.right
@@ -0,0 +1,3 @@
+1:YES:0
+2:no:1
+3:YES:0
diff --git a/shell/hush_test/hush-test2/strops5.tests b/shell/hush_test/hush-test2/strops5.tests
new file mode 100755
index 0000000..ee01e5c
--- /dev/null
+++ b/shell/hush_test/hush-test2/strops5.tests
@@ -0,0 +1,13 @@
+v='*.z'
+[[ a.z = *.z ]]; echo 1:YES:$?
+[[ a.z = "*".z ]]; echo 2:no:$?
+[[ a.z == $v ]]; echo 3:YES:$?
+
+# 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 \*