From: David Bremner <brem...@debian.org>

This test is intended to verify that '(' and ')' are passed through
unscathed to Xapian to parse.
---
 test/tagging |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/test/tagging b/test/tagging
index 748d947..70be943 100755
--- a/test/tagging
+++ b/test/tagging
@@ -202,6 +202,26 @@ notmuch dump --format=batch-tag | sort > OUTPUT
 notmuch restore --format=batch-tag < BACKUP
 test_expect_equal_file EXPECTED OUTPUT
 
+test_begin_subtest '--batch: compound queries with parens'
+notmuch dump --format=batch-tag > BACKUP
+
+notmuch tag --batch <<EOF
++compound%201 -- (One or Two)
++compound%402 -- (One or Two )
++compound%403 -- (%4Fne or Tw%6f)
++compound3 -- (tag:compound%201 and tag:compound%402) and Two
++compound4 -- ((id:msg-001@notmuch-test-suite and (not 
id:msg-002@notmuch-test-suite)) or (foo and bar))
+EOF
+
+cat <<EOF > EXPECTED
++compound%201 +compound3 +compound@2 +compound@3 +inbox +tag4 +tag5 +unread -- 
id:msg-002@notmuch-test-suite
++compound%201 +compound4 +compound@2 +compound@3 +inbox +tag5 +unread -- 
id:msg-001@notmuch-test-suite
+EOF
+
+notmuch dump --format=batch-tag | sort > OUTPUT
+notmuch restore --format=batch-tag < BACKUP
+test_expect_equal_file EXPECTED OUTPUT
+
 test_begin_subtest '--batch: unicode tags'
 notmuch dump --format=batch-tag > BACKUP
 
-- 
1.7.10.4

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

Reply via email to