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