[Patch v7 12/14] test/tagging: add test for compound queries with batch tagging

david at tethera.net david at tethera.net
Fri Dec 14 05:34:20 PST 2012


From: David Bremner <bremner at debian.org>

This is to watch for errors in quoting the query.
---
 test/tagging |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/test/tagging b/test/tagging
index 1d59af0..bd8eeb5 100755
--- a/test/tagging
+++ b/test/tagging
@@ -174,6 +174,28 @@ 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'
+notmuch dump --format=batch-tag > BACKUP
+
+notmuch tag --batch <<EOF
++compound1 -- One and Two
++compound2 -- One or Two
++tag%20with%20spaces -- *
++compound3 -- id:msg-002 at notmuch-test-suite and Two
++compound3 -- Two and id:msg-002 at notmuch-test-suite
+-unread -- tag:tag%20with%20spaces and id:msg-002 at notmuch-test-suite
+-tag%20with%20spaces -- tag:unread and tag:compound2
+EOF
+
+cat <<EOF > EXPECTED
++compound2 +compound3 +inbox +tag%20with%20spaces +tag4 +tag5 -- id:msg-002 at notmuch-test-suite
++compound2 +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