[WIP2 4/5] test: add known broken tests for parenthesized subqueries

David Bremner david at tethera.net
Sat Aug 31 18:37:47 PDT 2019


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



More information about the notmuch mailing list