From 64981b4c8e88812c322bee3832f1d421ff670ed5 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 1 Nov 2020 18:47:24 +0100 Subject: hush: document bugs in [[ =~ ]] comparison Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-bugs/strops5_bug.right | 2 ++ shell/hush_test/hush-bugs/strops5_bug.tests | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 shell/hush_test/hush-bugs/strops5_bug.right create mode 100755 shell/hush_test/hush-bugs/strops5_bug.tests (limited to 'shell/hush_test/hush-bugs') diff --git a/shell/hush_test/hush-bugs/strops5_bug.right b/shell/hush_test/hush-bugs/strops5_bug.right new file mode 100644 index 0000000..aba7bb4 --- /dev/null +++ b/shell/hush_test/hush-bugs/strops5_bug.right @@ -0,0 +1,2 @@ +4:no:1 +5:YES:0 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 \* -- cgit v1.1