[Patch v9 17/17] test/tagging: add test for handling of parenthesized tag queries.

david at tethera.net david at tethera.net
Sun Dec 23 17:39:43 PST 2012


From: David Bremner <bremner at 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 at notmuch-test-suite and (not id:msg-002 at notmuch-test-suite)) or (foo and bar))
+EOF
+
+cat <<EOF > EXPECTED
++compound%201 +compound3 +compound at 2 +compound at 3 +inbox +tag4 +tag5 +unread -- id:msg-002 at notmuch-test-suite
++compound%201 +compound4 +compound at 2 +compound at 3 +inbox +tag5 +unread -- id:msg-001 at 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



More information about the notmuch mailing list