aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-02-24 22:41:03 -0400
committerDavid Bremner <david@tethera.net>2022-03-19 07:27:29 -0300
commit8ed6a172b35708428f84f30af44fa81c12852e43 (patch)
tree64c1a4a8b2beb13abacb74aa77ecaefb555ec976 /test
parentc9ed87f39f54b83ecafc719e848909da6074075f (diff)
lib: do not phrase parse prefixed bracketed subexpressions
Since Xapian does not preserve quotes when passing the subquery to a field processor, we have to make a guess as to what the user intended. Here the added assumption is that a string surrounded by parens is not intended to be a phrase.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T650-regexp-query.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh
index 4ee6b171..a9844501 100755
--- a/test/T650-regexp-query.sh
+++ b/test/T650-regexp-query.sh
@@ -66,23 +66,30 @@ EOF
test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "bracketed subject search (with dquotes)"
-test_subtest_known_broken
notmuch search subject:notmuch and subject:show > EXPECTED
notmuch search 'subject:"(show notmuch)"' > OUTPUT
test_expect_equal_file_nonempty EXPECTED OUTPUT
test_begin_subtest "bracketed subject search (with dquotes and operator 'or')"
-test_subtest_known_broken
notmuch search subject:notmuch or subject:show > EXPECTED
notmuch search 'subject:"(notmuch or show)"' > OUTPUT
test_expect_equal_file_nonempty EXPECTED OUTPUT
test_begin_subtest "bracketed subject search (with dquotes and operator 'and')"
-test_subtest_known_broken
notmuch search subject:notmuch and subject:show > EXPECTED
notmuch search 'subject:"(notmuch and show)"' > OUTPUT
test_expect_equal_file_nonempty EXPECTED OUTPUT
+test_begin_subtest "bracketed subject search (with phrase, operator 'or')"
+notmuch search 'subject:"mailing list"' or subject:FreeBSD > EXPECTED
+notmuch search 'subject:"(""mailing list"" or FreeBSD)"' > OUTPUT
+test_expect_equal_file_nonempty EXPECTED OUTPUT
+
+test_begin_subtest "bracketed subject search (with phrase, operator 'and')"
+notmuch search search 'subject:"notmuch show"' and subject:commands > EXPECTED
+notmuch search 'subject:"(""notmuch show"" and commands)"' > OUTPUT
+test_expect_equal_file_nonempty EXPECTED OUTPUT
+
test_begin_subtest "xapian wildcard search for from:"
notmuch search --output=messages 'from:cwo*' > OUTPUT
test_expect_equal_file cworth.msg-ids OUTPUT