Re: [PATCH v2 4/6] test: add some exclude tests
authorAustin Clements <amdragon@MIT.EDU>
Fri, 6 Apr 2012 01:35:57 +0000 (21:35 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:03 +0000 (09:46 -0800)
87/ad1cca36b2707c2c84272300d0e55d69aa58e7 [new file with mode: 0644]

diff --git a/87/ad1cca36b2707c2c84272300d0e55d69aa58e7 b/87/ad1cca36b2707c2c84272300d0e55d69aa58e7
new file mode 100644 (file)
index 0000000..057b2e6
--- /dev/null
@@ -0,0 +1,505 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1DC08431FB6\r
+       for <notmuch@notmuchmail.org>; Thu,  5 Apr 2012 18:36:03 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7xRO52bNcfTA for <notmuch@notmuchmail.org>;\r
+       Thu,  5 Apr 2012 18:36:01 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
+       [18.7.68.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 32784431FAE\r
+       for <notmuch@notmuchmail.org>; Thu,  5 Apr 2012 18:36:01 -0700 (PDT)\r
+X-AuditID: 12074422-b7fd66d0000008f9-d6-4f7e488075b0\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A2.E9.02297.0884E7F4; Thu,  5 Apr 2012 21:36:00 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q361Zxxo024863; \r
+       Thu, 5 Apr 2012 21:36:00 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q361ZwR0017610\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 5 Apr 2012 21:35:59 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SFy5m-0004T8-HH; Thu, 05 Apr 2012 21:35:58 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 4/6] test: add some exclude tests\r
+In-Reply-To: <1333234442-28616-5-git-send-email-markwalters1009@gmail.com>\r
+References: <1333234442-28616-1-git-send-email-markwalters1009@gmail.com>\r
+       <1333234442-28616-5-git-send-email-markwalters1009@gmail.com>User-Agent:\r
+       Notmuch/0.11.1+358~g3b96caf (http://notmuchmail.org)\r
+       Emacs/23.3.1 (i486-pc-linux-gnu)\r
+Date: Thu, 05 Apr 2012 21:35:57 -0400\r
+Message-ID: <87y5q9bq0y.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrHIsWRmVeSWpSXmKPExsUixCmqrNvgUedvsKNH12L1XB6L6zdnMjsw\r
+       eeycdZfd49mqW8wBTFFcNimpOZllqUX6dglcGT27L7AVPJ/CWLH21zrmBsY3tV2MnBwSAiYS\r
+       66d9ZoWwxSQu3FvP1sXIxSEksI9R4nDbY2aQhJDAekaJs6e4IBInmCTuPl7NCuEsYZQ4cvAU\r
+       C0gVm4CGxLb9yxlBbBEBV4mn3z6DdQsLWEjMW3ALzOYU8JJYNeMWVPMLRol5G88ygSRYBFQl\r
+       Zpz6AlbEC3TTivZGVghbUOLkzCdgC5gF1CX+zLvEDGFrSyxb+Jp5AqPALCRls5CUzUJStoCR\r
+       eRWjbEpulW5uYmZOcWqybnFyYl5eapGuqV5uZoleakrpJkZQsLK7KO1g/HlQ6RCjAAejEg9v\r
+       yeZafyHWxLLiytxDjJIcTEqivPqudf5CfEn5KZUZicUZ8UWlOanFhxglOJiVRHif8gPleFMS\r
+       K6tSi/JhUtIcLErivOpa7/yEBNITS1KzU1MLUotgsjIcHEoSvBfdgRoFi1LTUyvSMnNKENJM\r
+       HJwgw3mAhn8HqeEtLkjMLc5Mh8ifYlSUEuc9DpIQAElklObB9cKSyStGcaBXhHkfgVTxABMR\r
+       XPcroMFMQINPfq0GGVySiJCSamBkmHSFz1Yuf5/qosImk8Rn65QCbu/5u/NBxf2CF+2bN0+1\r
+       iN6u9jP9kAnXnAelzWriMzf2LD6iUMr8ee9V5xnKghZOx15v+nFSdK66y7e/ysvrxI5+tnfV\r
+       M163lanmS3Hm/EXhj1ftu7qpj9to+zZJpwKvl3Pdp2StfMAtJOsltsjIN/ZlVPxRJZbijERD\r
+       Leai4kQAdr5ZWgEDAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 06 Apr 2012 01:36:03 -0000\r
+\r
+On Sat, 31 Mar 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> Systematically test the exclude options for search. Also move the\r
+> search existing exclude tests into the new test. There is some overlap\r
+> between the two sets of tests but many of the existing ones are there\r
+> because they triggered bugs in the past so I have kept them to ensure\r
+> coverage.\r
+> ---\r
+>  test/notmuch-test    |    1 +\r
+>  test/search          |   48 -----------\r
+>  test/search-excludes |  214 ++++++++++++++++++++++++++++++++++++++++++++=\r
+++++++\r
+>  3 files changed, 215 insertions(+), 48 deletions(-)\r
+>  create mode 100755 test/search-excludes\r
+>\r
+> diff --git a/test/notmuch-test b/test/notmuch-test\r
+> index f03b594..4dcd8c6 100755\r
+> --- a/test/notmuch-test\r
+> +++ b/test/notmuch-test\r
+> @@ -27,6 +27,7 @@ TESTS=3D"\r
+>    search-position-overlap-bug\r
+>    search-insufficient-from-quoting\r
+>    search-limiting\r
+> +  search-excludes\r
+>    tagging\r
+>    json\r
+>    multipart\r
+> diff --git a/test/search b/test/search\r
+> index 17af6a2..a7a0b18 100755\r
+> --- a/test/search\r
+> +++ b/test/search\r
+> @@ -129,52 +129,4 @@ add_message '[subject]=3D"utf8-message-body-subject"=\r
+' '[date]=3D"Sat, 01 Jan 2000 12\r
+>  output=3D$(notmuch search "b=C3=B6d=C3=BD" | notmuch_search_sanitize)\r
+>  test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test =\r
+Suite; utf8-message-body-subject (inbox unread)"\r
+>=20=20\r
+> -test_begin_subtest "Exclude \"deleted\" messages from search"\r
+> -notmuch config set search.exclude_tags deleted\r
+> -generate_message '[subject]=3D"Not deleted"'\r
+> -not_deleted_id=3D$gen_msg_id\r
+> -generate_message '[subject]=3D"Deleted"'\r
+> -notmuch new > /dev/null\r
+> -notmuch tag +deleted id:$gen_msg_id\r
+> -deleted_id=3D$gen_msg_id\r
+> -output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+> -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)\r
+> -thread:XXX   2001-01-05 [0/1] Notmuch Test Suite; Deleted (deleted inbox=\r
+ unread)"\r
+> -\r
+> -test_begin_subtest "Exclude \"deleted\" messages from message search"\r
+> -output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
+search_sanitize)\r
+> -test_expect_equal "$output" "id:$not_deleted_id"\r
+> -\r
+> -test_begin_subtest "Exclude \"deleted\" messages from message search (no=\r
+-exclude)"\r
+> -output=3D$(notmuch search --no-exclude --output=3Dmessages subject:delet=\r
+ed | notmuch_search_sanitize)\r
+> -test_expect_equal "$output" "id:$not_deleted_id\r
+> -id:$deleted_id"\r
+> -\r
+> -test_begin_subtest "Exclude \"deleted\" messages from message search (no=\r
+n-existent exclude-tag)"\r
+> -notmuch config set search.exclude_tags deleted non_existent_tag\r
+> -output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
+search_sanitize)\r
+> -test_expect_equal "$output" "id:$not_deleted_id"\r
+> -notmuch config set search.exclude_tags deleted\r
+> -\r
+> -test_begin_subtest "Exclude \"deleted\" messages from search, overridden"\r
+> -output=3D$(notmuch search subject:deleted and tag:deleted | notmuch_sear=\r
+ch_sanitize)\r
+> -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Deleted (deleted inbox unread)"\r
+> -\r
+> -test_begin_subtest "Exclude \"deleted\" messages from threads"\r
+> -add_message '[subject]=3D"Not deleted reply"' '[in-reply-to]=3D"<$gen_ms=\r
+g_id>"'\r
+> -output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+> -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)\r
+> -thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (del=\r
+eted inbox unread)"\r
+> -\r
+> -test_begin_subtest "Don't exclude \"deleted\" messages when --no-exclude=\r
+ specified"\r
+> -output=3D$(notmuch search --no-exclude subject:deleted | notmuch_search_=\r
+sanitize)\r
+> -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)\r
+> -thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox=\r
+ unread)"\r
+> -\r
+> -test_begin_subtest "Don't exclude \"deleted\" messages from search if no=\r
+t configured"\r
+> -notmuch config set search.exclude_tags\r
+> -output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+> -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)\r
+> -thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox=\r
+ unread)"\r
+> -\r
+>  test_done\r
+> diff --git a/test/search-excludes b/test/search-excludes\r
+> new file mode 100755\r
+> index 0000000..63acb7b\r
+> --- /dev/null\r
+> +++ b/test/search-excludes\r
+> @@ -0,0 +1,214 @@\r
+> +#!/usr/bin/env bash\r
+> +test_description=3D'"notmuch search" with excludes in several variations'\r
+> +. ./test-lib.sh\r
+> +\r
+> +# Generates a thread of 'length' messages. The subject of the nth\r
+> +# message in the thread is 'subject: message n'\r
+> +generate_thread ()\r
+> +{\r
+> +    local subject=3D"$1"\r
+> +    local length=3D"$2"\r
+> +    generate_message '[subject]=3D"'"${subject}: message 1"'"'\r
+> +    parent_id=3D$gen_msg_id\r
+> +    for i in `seq 2 $length`\r
+> +    do\r
+> +    generate_message '[subject]=3D"'"${subject}: message $i"'"' \\r
+> +                     "[in-reply-to]=3D\<$parent_id\>"\r
+> +    parent_id=3D$gen_msg_id\r
+> +    done\r
+> +    notmuch new > /dev/null\r
+> +}\r
+> +\r
+> +# These are the original search exclude tests.\r
+> +\r
+> +test_begin_subtest "Exclude \"deleted\" messages from search"\r
+> +notmuch config set search.exclude_tags deleted\r
+> +generate_message '[subject]=3D"Not deleted"'\r
+> +not_deleted_id=3D$gen_msg_id\r
+> +generate_message '[subject]=3D"Deleted"'\r
+> +notmuch new > /dev/null\r
+> +notmuch tag +deleted id:$gen_msg_id\r
+> +deleted_id=3D$gen_msg_id\r
+> +output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)"\r
+> +\r
+> +test_begin_subtest "Exclude \"deleted\" messages from message search"\r
+> +output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
+search_sanitize)\r
+> +test_expect_equal "$output" "id:$not_deleted_id"\r
+> +\r
+> +test_begin_subtest "Exclude \"deleted\" messages from message search --e=\r
+xclude=3Dfalse"\r
+> +output=3D$(notmuch search --exclude=3Dfalse --output=3Dmessages subject:=\r
+deleted | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "id:$not_deleted_id\r
+> +id:$deleted_id"\r
+> +\r
+> +test_begin_subtest "Exclude \"deleted\" messages from message search (no=\r
+n-existent exclude-tag)"\r
+> +notmuch config set search.exclude_tags deleted non_existent_tag\r
+> +output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
+search_sanitize)\r
+> +test_expect_equal "$output" "id:$not_deleted_id"\r
+> +notmuch config set search.exclude_tags deleted\r
+> +\r
+> +test_begin_subtest "Exclude \"deleted\" messages from search, overridden"\r
+> +output=3D$(notmuch search subject:deleted and tag:deleted | notmuch_sear=\r
+ch_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Deleted (deleted inbox unread)"\r
+> +\r
+> +test_begin_subtest "Exclude \"deleted\" messages from threads"\r
+> +add_message '[subject]=3D"Not deleted reply"' '[in-reply-to]=3D"<$gen_ms=\r
+g_id>"'\r
+> +output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)\r
+> +thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (del=\r
+eted inbox unread)"\r
+> +\r
+> +test_begin_subtest "Don't exclude \"deleted\" messages when --exclude=3D=\r
+flag specified"\r
+> +output=3D$(notmuch search --exclude=3Dflag subject:deleted | notmuch_sea=\r
+rch_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)\r
+> +thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (del=\r
+eted inbox unread)"\r
+> +\r
+> +test_begin_subtest "Don't exclude \"deleted\" messages from search if no=\r
+t configured"\r
+> +notmuch config set search.exclude_tags\r
+> +output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
+Suite; Not deleted (inbox unread)\r
+> +thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox=\r
+ unread)"\r
+> +\r
+> +\r
+> +\r
+> +\r
+> +# We construct some threads for the tests. We use the tag "test" to\r
+> +# indicate which messages we will search for.\r
+> +\r
+> +# A thread of deleted messages; test matches one of them.\r
+> +generate_thread "All messages excluded: single match" 5\r
+> +notmuch tag +deleted subject:"All messages excluded: single match*"\r
+\r
+I think you meant\r
+  notmuch tag +deleted 'subject:"All messages excluded: single match"'\r
+since what you wrote will search for "All" in the subject and the rest\r
+of the words anywhere in the message and the glob at the end won't do\r
+anything.  The same goes for all of your other queries.\r
+\r
+Alternatively, maybe generate_thread could do a query to get the thread\r
+ID from $gen_msg_id and stuff that in a variable (e.g., $gen_thread_id)\r
+that you could use for tagging.  That would probably be much less\r
+painful.  It could also stuff the generated message IDs in an array that\r
+you could use to refer to individual messages.\r
+\r
+> +notmuch tag +test 'subject:All messages excluded: single match: message =\r
+2'\r
+> +\r
+> +# A thread of deleted messages; test matches two of them.\r
+> +generate_thread "All messages excluded: double match" 5\r
+> +notmuch tag +deleted subject:"All messages excluded: double match*"\r
+> +notmuch tag +test 'subject:All messages excluded: double match: message =\r
+2'\r
+> +notmuch tag +test 'subject:All messages excluded: double match: message =\r
+4'\r
+> +\r
+> +# A thread some messages deleted; test only matches a deleted message.\r
+> +generate_thread "Some messages excluded: single excluded match" 5\r
+> +notmuch tag +deleted +test 'subject:Some messages excluded: single exclu=\r
+ded match: message 3'\r
+> +\r
+> +# A thread some messages deleted; test only matches a non-deleted messag=\r
+e.\r
+> +generate_thread "Some messages excluded: single non-excluded match" 5\r
+> +notmuch tag +deleted 'subject:Some messages excluded: single non-exclude=\r
+d match: message 2'\r
+> +notmuch tag +test 'subject:Some messages excluded: single non-excluded m=\r
+atch: message 4'\r
+> +\r
+> +# A thread no messages deleted; test matches a message.\r
+> +generate_thread "No messages excluded: single match" 5\r
+> +notmuch tag +test 'subject:No messages excluded: single match: message 3'\r
+> +\r
+> +# Temporarily remove excludes to get list of matching messages\r
+> +notmuch config set search.exclude_tags\r
+> +matching_message_ids=3D( `notmuch search --output=3Dmessages tag:test` )\r
+> +notmuch config set search.exclude_tags deleted\r
+> +\r
+> +test_begin_subtest "Default exclusion (thread summary)"\r
+> +output=3D$(notmuch search tag:test | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
+Suite; Some messages excluded: single non-excluded match: message 4 (delete=\r
+d inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
+single match: message 3 (inbox test unread)"\r
+> +\r
+> +test_begin_subtest "Default exclusion (messages)"\r
+> +output=3D$(notmuch search --output=3Dmessages tag:test | notmuch_search_=\r
+sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[4]}\r
+> +${matching_message_ids[5]}"\r
+\r
+Just a thought...  Are we depending on notmuch using a stable sort to\r
+guarantee this order, given that it's sorting by timestamps with only\r
+second granularity?  We make this same assumption all over the test\r
+suite, so I don't think you have to worry about it here, but this hadn't\r
+occurred to me before.\r
+\r
+> +\r
+> +test_begin_subtest "exclude=3Dtrue (thread summary)"\r
+> +output=3D$(notmuch search --exclude=3Dtrue tag:test | notmuch_search_san=\r
+itize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
+Suite; Some messages excluded: single non-excluded match: message 4 (delete=\r
+d inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
+single match: message 3 (inbox test unread)"\r
+> +\r
+> +test_begin_subtest "exclude=3Dtrue (messages)"\r
+> +output=3D$(notmuch search --exclude=3Dtrue --output=3Dmessages tag:test =\r
+| notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[4]}\r
+> +${matching_message_ids[5]}"\r
+> +\r
+> +test_begin_subtest "exclude=3Dfalse (thread summary)"\r
+> +output=3D$(notmuch search --exclude=3Dfalse tag:test | notmuch_search_sa=\r
+nitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
+Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
+nread)\r
+> +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
+ double match: message 2 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
+: single excluded match: message 3 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
+: single non-excluded match: message 4 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
+single match: message 3 (inbox test unread)"\r
+> +\r
+> +test_begin_subtest "exclude=3Dfalse (messages)"\r
+> +output=3D$(notmuch search --exclude=3Dfalse --output=3Dmessages tag:test=\r
+ | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[0]}\r
+> +${matching_message_ids[1]}\r
+> +${matching_message_ids[2]}\r
+> +${matching_message_ids[3]}\r
+> +${matching_message_ids[4]}\r
+> +${matching_message_ids[5]}"\r
+> +\r
+> +test_begin_subtest "exclude=3Dflag (thread summary)"\r
+> +output=3D$(notmuch search --exclude=3Dflag tag:test | notmuch_search_san=\r
+itize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [0/5] Notmuch Test =\r
+Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
+nread)\r
+> +thread:XXX   2001-01-05 [0/5] Notmuch Test Suite; All messages excluded:=\r
+ double match: message 4 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [0/5] Notmuch Test Suite; Some messages excluded=\r
+: single excluded match: message 3 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
+: single non-excluded match: message 4 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
+single match: message 3 (inbox test unread)"\r
+> +\r
+> +test_begin_subtest "exclude=3Dflag (messages)"\r
+> +output=3D$(notmuch search --exclude=3Dflag --output=3Dmessages tag:test =\r
+| notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[0]}\r
+> +${matching_message_ids[1]}\r
+> +${matching_message_ids[2]}\r
+> +${matching_message_ids[3]}\r
+> +${matching_message_ids[4]}\r
+> +${matching_message_ids[5]}"\r
+> +\r
+> +test_begin_subtest "Default exclusion: tag in query (thread summary)"\r
+> +output=3D$(notmuch search tag:test and tag:deleted | notmuch_search_sani=\r
+tize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
+Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
+nread)\r
+> +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
+ double match: message 2 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
+: single excluded match: message 3 (deleted inbox test unread)"\r
+> +\r
+> +test_begin_subtest "Default exclusion: tag in query (messages)"\r
+> +output=3D$(notmuch search --output=3Dmessages tag:test and tag:deleted |=\r
+ notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[0]}\r
+> +${matching_message_ids[1]}\r
+> +${matching_message_ids[2]}\r
+> +${matching_message_ids[3]}"\r
+> +\r
+> +test_begin_subtest "exclude=3Dtrue: tag in query (thread summary)"\r
+> +output=3D$(notmuch search --exclude=3Dtrue tag:test and tag:deleted | no=\r
+tmuch_search_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
+Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
+nread)\r
+> +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
+ double match: message 2 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
+: single excluded match: message 3 (deleted inbox test unread)"\r
+> +\r
+> +test_begin_subtest "exclude=3Dtrue: tag in query (messages)"\r
+> +output=3D$(notmuch search --exclude=3Dtrue --output=3Dmessages tag:test =\r
+and tag:deleted | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[0]}\r
+> +${matching_message_ids[1]}\r
+> +${matching_message_ids[2]}\r
+> +${matching_message_ids[3]}"\r
+> +\r
+> +test_begin_subtest "exclude=3Dfalse: tag in query (thread summary)"\r
+> +output=3D$(notmuch search --exclude=3Dfalse tag:test and tag:deleted | n=\r
+otmuch_search_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
+Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
+nread)\r
+> +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
+ double match: message 2 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
+: single excluded match: message 3 (deleted inbox test unread)"\r
+> +\r
+> +test_begin_subtest "exclude=3Dfalse: tag in query (messages)"\r
+> +output=3D$(notmuch search --exclude=3Dfalse --output=3Dmessages tag:test=\r
+ and tag:deleted | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[0]}\r
+> +${matching_message_ids[1]}\r
+> +${matching_message_ids[2]}\r
+> +${matching_message_ids[3]}"\r
+> +\r
+> +test_begin_subtest "exclude=3Dflag: tag in query (thread summary)"\r
+> +output=3D$(notmuch search --exclude=3Dflag tag:test and tag:deleted | no=\r
+tmuch_search_sanitize)\r
+> +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
+Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
+nread)\r
+> +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
+ double match: message 2 (deleted inbox test unread)\r
+> +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
+: single excluded match: message 3 (deleted inbox test unread)"\r
+> +\r
+> +test_begin_subtest "exclude=3Dflag: tag in query (messages)"\r
+> +output=3D$(notmuch search --exclude=3Dflag --output=3Dmessages tag:test =\r
+and tag:deleted | notmuch_search_sanitize)\r
+> +test_expect_equal "$output" "${matching_message_ids[0]}\r
+> +${matching_message_ids[1]}\r
+> +${matching_message_ids[2]}\r
+> +${matching_message_ids[3]}"\r
+> +\r
+> +\r
+> +\r
+> +test_done\r
+\r
+Awesome.\r
+\r
+> --=20\r
+> 1.7.9.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r