From: David Bremner <bremner@debian.org> This is to watch for errors in quoting the query. --- test/tagging | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/tagging b/test/tagging index 1d59af0..88cd18b 100755 --- a/test/tagging +++ b/test/tagging @@ -174,6 +174,34 @@ 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 +# match nothing ++compound1 -- One and Two +# match everything ++compound2 -- One or Two ++tag%20with%20spaces -- * +# redundant compound query ++compound3 -- id:msg-002@notmuch-test-suite and Two +# check for prefix in second token ++compound4 -- Two and id:msg-002@notmuch-test-suite +# both have prefixes +-unread -- tag:tag%20with%20spaces and id:msg-002@notmuch-test-suite +# remove from only msg-001 +-tag%20with%20spaces -- tag:unread and tag:compound2 +EOF + +cat <<EOF > EXPECTED ++compound2 +compound3 +compound4 +inbox +tag%20with%20spaces +tag4 +tag5 -- id:msg-002@notmuch-test-suite ++compound2 +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