The quoting around the () is needed because of our choice of using
boolean fields at the Xapian level, and [1]

[1]: https://trac.xapian.org/ticket/795
---
 test/T650-regexp-query.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh
index 43af3b47..05a04791 100755
--- a/test/T650-regexp-query.sh
+++ b/test/T650-regexp-query.sh
@@ -182,4 +182,28 @@ notmuch search tag:signed > EXPECTED
 notmuch search tag:/^si/ > OUTPUT
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest "parenthesized subqueries are not phrases"
+test_subtest_known_broken
+notmuch search subject:notmuch AND subject:outputs > EXPECTED
+notmuch search 'subject:"(notmuch outputs)"' > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "parenthesized subqueries work with OR"
+test_subtest_known_broken
+notmuch search subject:notmuch OR subject:outputs > EXPECTED
+notmuch search 'subject:"(notmuch OR outputs)"' > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "parenthesized subqueries work with AND"
+test_subtest_known_broken
+notmuch search subject:notmuch AND subject:outputs > EXPECTED
+notmuch search 'subject:"(notmuch AND outputs)"' > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "parenthesized subqueries work with overidden prefix"
+test_subtest_known_broken
+notmuch search subject:help AND subject:outputs AND to:notmuch > EXPECTED
+notmuch search 'subject:"(outputs help to:notmuch)"' > OUTPUT
+test_expect_equal_file EXPECTED OUTPUT
+
 test_done
-- 
2.23.0.rc1

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to