Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 87 / ad1cca36b2707c2c84272300d0e55d69aa58e7
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 1DC08431FB6\r
6         for <notmuch@notmuchmail.org>; Thu,  5 Apr 2012 18:36:03 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 7xRO52bNcfTA for <notmuch@notmuchmail.org>;\r
16         Thu,  5 Apr 2012 18:36:01 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 32784431FAE\r
20         for <notmuch@notmuchmail.org>; Thu,  5 Apr 2012 18:36:01 -0700 (PDT)\r
21 X-AuditID: 12074422-b7fd66d0000008f9-d6-4f7e488075b0\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id A2.E9.02297.0884E7F4; Thu,  5 Apr 2012 21:36:00 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q361Zxxo024863; \r
27         Thu, 5 Apr 2012 21:36:00 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q361ZwR0017610\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Thu, 5 Apr 2012 21:35:59 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1SFy5m-0004T8-HH; Thu, 05 Apr 2012 21:35:58 -0400\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
39 Subject: Re: [PATCH v2 4/6] test: add some exclude tests\r
40 In-Reply-To: <1333234442-28616-5-git-send-email-markwalters1009@gmail.com>\r
41 References: <1333234442-28616-1-git-send-email-markwalters1009@gmail.com>\r
42         <1333234442-28616-5-git-send-email-markwalters1009@gmail.com>User-Agent:\r
43         Notmuch/0.11.1+358~g3b96caf (http://notmuchmail.org)\r
44         Emacs/23.3.1 (i486-pc-linux-gnu)\r
45 Date: Thu, 05 Apr 2012 21:35:57 -0400\r
46 Message-ID: <87y5q9bq0y.fsf@awakening.csail.mit.edu>\r
47 MIME-Version: 1.0\r
48 Content-Type: text/plain; charset=utf-8\r
49 Content-Transfer-Encoding: quoted-printable\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFnrHIsWRmVeSWpSXmKPExsUixCmqrNvgUedvsKNH12L1XB6L6zdnMjsw\r
52         eeycdZfd49mqW8wBTFFcNimpOZllqUX6dglcGT27L7AVPJ/CWLH21zrmBsY3tV2MnBwSAiYS\r
53         66d9ZoWwxSQu3FvP1sXIxSEksI9R4nDbY2aQhJDAekaJs6e4IBInmCTuPl7NCuEsYZQ4cvAU\r
54         C0gVm4CGxLb9yxlBbBEBV4mn3z6DdQsLWEjMW3ALzOYU8JJYNeMWVPMLRol5G88ygSRYBFQl\r
55         Zpz6AlbEC3TTivZGVghbUOLkzCdgC5gF1CX+zLvEDGFrSyxb+Jp5AqPALCRls5CUzUJStoCR\r
56         eRWjbEpulW5uYmZOcWqybnFyYl5eapGuqV5uZoleakrpJkZQsLK7KO1g/HlQ6RCjAAejEg9v\r
57         yeZafyHWxLLiytxDjJIcTEqivPqudf5CfEn5KZUZicUZ8UWlOanFhxglOJiVRHif8gPleFMS\r
58         K6tSi/JhUtIcLErivOpa7/yEBNITS1KzU1MLUotgsjIcHEoSvBfdgRoFi1LTUyvSMnNKENJM\r
59         HJwgw3mAhn8HqeEtLkjMLc5Mh8ifYlSUEuc9DpIQAElklObB9cKSyStGcaBXhHkfgVTxABMR\r
60         XPcroMFMQINPfq0GGVySiJCSamBkmHSFz1Yuf5/qosImk8Rn65QCbu/5u/NBxf2CF+2bN0+1\r
61         iN6u9jP9kAnXnAelzWriMzf2LD6iUMr8ee9V5xnKghZOx15v+nFSdK66y7e/ysvrxI5+tnfV\r
62         M163lanmS3Hm/EXhj1ftu7qpj9to+zZJpwKvl3Pdp2StfMAtJOsltsjIN/ZlVPxRJZbijERD\r
63         Leai4kQAdr5ZWgEDAAA=\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Fri, 06 Apr 2012 01:36:03 -0000\r
77 \r
78 On Sat, 31 Mar 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
79 > Systematically test the exclude options for search. Also move the\r
80 > search existing exclude tests into the new test. There is some overlap\r
81 > between the two sets of tests but many of the existing ones are there\r
82 > because they triggered bugs in the past so I have kept them to ensure\r
83 > coverage.\r
84 > ---\r
85 >  test/notmuch-test    |    1 +\r
86 >  test/search          |   48 -----------\r
87 >  test/search-excludes |  214 ++++++++++++++++++++++++++++++++++++++++++++=\r
88 ++++++\r
89 >  3 files changed, 215 insertions(+), 48 deletions(-)\r
90 >  create mode 100755 test/search-excludes\r
91 >\r
92 > diff --git a/test/notmuch-test b/test/notmuch-test\r
93 > index f03b594..4dcd8c6 100755\r
94 > --- a/test/notmuch-test\r
95 > +++ b/test/notmuch-test\r
96 > @@ -27,6 +27,7 @@ TESTS=3D"\r
97 >    search-position-overlap-bug\r
98 >    search-insufficient-from-quoting\r
99 >    search-limiting\r
100 > +  search-excludes\r
101 >    tagging\r
102 >    json\r
103 >    multipart\r
104 > diff --git a/test/search b/test/search\r
105 > index 17af6a2..a7a0b18 100755\r
106 > --- a/test/search\r
107 > +++ b/test/search\r
108 > @@ -129,52 +129,4 @@ add_message '[subject]=3D"utf8-message-body-subject"=\r
109 ' '[date]=3D"Sat, 01 Jan 2000 12\r
110 >  output=3D$(notmuch search "b=C3=B6d=C3=BD" | notmuch_search_sanitize)\r
111 >  test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test =\r
112 Suite; utf8-message-body-subject (inbox unread)"\r
113 >=20=20\r
114 > -test_begin_subtest "Exclude \"deleted\" messages from search"\r
115 > -notmuch config set search.exclude_tags deleted\r
116 > -generate_message '[subject]=3D"Not deleted"'\r
117 > -not_deleted_id=3D$gen_msg_id\r
118 > -generate_message '[subject]=3D"Deleted"'\r
119 > -notmuch new > /dev/null\r
120 > -notmuch tag +deleted id:$gen_msg_id\r
121 > -deleted_id=3D$gen_msg_id\r
122 > -output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
123 > -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
124 Suite; Not deleted (inbox unread)\r
125 > -thread:XXX   2001-01-05 [0/1] Notmuch Test Suite; Deleted (deleted inbox=\r
126  unread)"\r
127 > -\r
128 > -test_begin_subtest "Exclude \"deleted\" messages from message search"\r
129 > -output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
130 search_sanitize)\r
131 > -test_expect_equal "$output" "id:$not_deleted_id"\r
132 > -\r
133 > -test_begin_subtest "Exclude \"deleted\" messages from message search (no=\r
134 -exclude)"\r
135 > -output=3D$(notmuch search --no-exclude --output=3Dmessages subject:delet=\r
136 ed | notmuch_search_sanitize)\r
137 > -test_expect_equal "$output" "id:$not_deleted_id\r
138 > -id:$deleted_id"\r
139 > -\r
140 > -test_begin_subtest "Exclude \"deleted\" messages from message search (no=\r
141 n-existent exclude-tag)"\r
142 > -notmuch config set search.exclude_tags deleted non_existent_tag\r
143 > -output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
144 search_sanitize)\r
145 > -test_expect_equal "$output" "id:$not_deleted_id"\r
146 > -notmuch config set search.exclude_tags deleted\r
147 > -\r
148 > -test_begin_subtest "Exclude \"deleted\" messages from search, overridden"\r
149 > -output=3D$(notmuch search subject:deleted and tag:deleted | notmuch_sear=\r
150 ch_sanitize)\r
151 > -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
152 Suite; Deleted (deleted inbox unread)"\r
153 > -\r
154 > -test_begin_subtest "Exclude \"deleted\" messages from threads"\r
155 > -add_message '[subject]=3D"Not deleted reply"' '[in-reply-to]=3D"<$gen_ms=\r
156 g_id>"'\r
157 > -output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
158 > -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
159 Suite; Not deleted (inbox unread)\r
160 > -thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (del=\r
161 eted inbox unread)"\r
162 > -\r
163 > -test_begin_subtest "Don't exclude \"deleted\" messages when --no-exclude=\r
164  specified"\r
165 > -output=3D$(notmuch search --no-exclude subject:deleted | notmuch_search_=\r
166 sanitize)\r
167 > -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
168 Suite; Not deleted (inbox unread)\r
169 > -thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox=\r
170  unread)"\r
171 > -\r
172 > -test_begin_subtest "Don't exclude \"deleted\" messages from search if no=\r
173 t configured"\r
174 > -notmuch config set search.exclude_tags\r
175 > -output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
176 > -test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
177 Suite; Not deleted (inbox unread)\r
178 > -thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox=\r
179  unread)"\r
180 > -\r
181 >  test_done\r
182 > diff --git a/test/search-excludes b/test/search-excludes\r
183 > new file mode 100755\r
184 > index 0000000..63acb7b\r
185 > --- /dev/null\r
186 > +++ b/test/search-excludes\r
187 > @@ -0,0 +1,214 @@\r
188 > +#!/usr/bin/env bash\r
189 > +test_description=3D'"notmuch search" with excludes in several variations'\r
190 > +. ./test-lib.sh\r
191 > +\r
192 > +# Generates a thread of 'length' messages. The subject of the nth\r
193 > +# message in the thread is 'subject: message n'\r
194 > +generate_thread ()\r
195 > +{\r
196 > +    local subject=3D"$1"\r
197 > +    local length=3D"$2"\r
198 > +    generate_message '[subject]=3D"'"${subject}: message 1"'"'\r
199 > +    parent_id=3D$gen_msg_id\r
200 > +    for i in `seq 2 $length`\r
201 > +    do\r
202 > +     generate_message '[subject]=3D"'"${subject}: message $i"'"' \\r
203 > +                      "[in-reply-to]=3D\<$parent_id\>"\r
204 > +     parent_id=3D$gen_msg_id\r
205 > +    done\r
206 > +    notmuch new > /dev/null\r
207 > +}\r
208 > +\r
209 > +# These are the original search exclude tests.\r
210 > +\r
211 > +test_begin_subtest "Exclude \"deleted\" messages from search"\r
212 > +notmuch config set search.exclude_tags deleted\r
213 > +generate_message '[subject]=3D"Not deleted"'\r
214 > +not_deleted_id=3D$gen_msg_id\r
215 > +generate_message '[subject]=3D"Deleted"'\r
216 > +notmuch new > /dev/null\r
217 > +notmuch tag +deleted id:$gen_msg_id\r
218 > +deleted_id=3D$gen_msg_id\r
219 > +output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
220 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
221 Suite; Not deleted (inbox unread)"\r
222 > +\r
223 > +test_begin_subtest "Exclude \"deleted\" messages from message search"\r
224 > +output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
225 search_sanitize)\r
226 > +test_expect_equal "$output" "id:$not_deleted_id"\r
227 > +\r
228 > +test_begin_subtest "Exclude \"deleted\" messages from message search --e=\r
229 xclude=3Dfalse"\r
230 > +output=3D$(notmuch search --exclude=3Dfalse --output=3Dmessages subject:=\r
231 deleted | notmuch_search_sanitize)\r
232 > +test_expect_equal "$output" "id:$not_deleted_id\r
233 > +id:$deleted_id"\r
234 > +\r
235 > +test_begin_subtest "Exclude \"deleted\" messages from message search (no=\r
236 n-existent exclude-tag)"\r
237 > +notmuch config set search.exclude_tags deleted non_existent_tag\r
238 > +output=3D$(notmuch search --output=3Dmessages subject:deleted | notmuch_=\r
239 search_sanitize)\r
240 > +test_expect_equal "$output" "id:$not_deleted_id"\r
241 > +notmuch config set search.exclude_tags deleted\r
242 > +\r
243 > +test_begin_subtest "Exclude \"deleted\" messages from search, overridden"\r
244 > +output=3D$(notmuch search subject:deleted and tag:deleted | notmuch_sear=\r
245 ch_sanitize)\r
246 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
247 Suite; Deleted (deleted inbox unread)"\r
248 > +\r
249 > +test_begin_subtest "Exclude \"deleted\" messages from threads"\r
250 > +add_message '[subject]=3D"Not deleted reply"' '[in-reply-to]=3D"<$gen_ms=\r
251 g_id>"'\r
252 > +output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
253 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
254 Suite; Not deleted (inbox unread)\r
255 > +thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (del=\r
256 eted inbox unread)"\r
257 > +\r
258 > +test_begin_subtest "Don't exclude \"deleted\" messages when --exclude=3D=\r
259 flag specified"\r
260 > +output=3D$(notmuch search --exclude=3Dflag subject:deleted | notmuch_sea=\r
261 rch_sanitize)\r
262 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
263 Suite; Not deleted (inbox unread)\r
264 > +thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (del=\r
265 eted inbox unread)"\r
266 > +\r
267 > +test_begin_subtest "Don't exclude \"deleted\" messages from search if no=\r
268 t configured"\r
269 > +notmuch config set search.exclude_tags\r
270 > +output=3D$(notmuch search subject:deleted | notmuch_search_sanitize)\r
271 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test =\r
272 Suite; Not deleted (inbox unread)\r
273 > +thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox=\r
274  unread)"\r
275 > +\r
276 > +\r
277 > +\r
278 > +\r
279 > +# We construct some threads for the tests. We use the tag "test" to\r
280 > +# indicate which messages we will search for.\r
281 > +\r
282 > +# A thread of deleted messages; test matches one of them.\r
283 > +generate_thread "All messages excluded: single match" 5\r
284 > +notmuch tag +deleted subject:"All messages excluded: single match*"\r
285 \r
286 I think you meant\r
287   notmuch tag +deleted 'subject:"All messages excluded: single match"'\r
288 since what you wrote will search for "All" in the subject and the rest\r
289 of the words anywhere in the message and the glob at the end won't do\r
290 anything.  The same goes for all of your other queries.\r
291 \r
292 Alternatively, maybe generate_thread could do a query to get the thread\r
293 ID from $gen_msg_id and stuff that in a variable (e.g., $gen_thread_id)\r
294 that you could use for tagging.  That would probably be much less\r
295 painful.  It could also stuff the generated message IDs in an array that\r
296 you could use to refer to individual messages.\r
297 \r
298 > +notmuch tag +test 'subject:All messages excluded: single match: message =\r
299 2'\r
300 > +\r
301 > +# A thread of deleted messages; test matches two of them.\r
302 > +generate_thread "All messages excluded: double match" 5\r
303 > +notmuch tag +deleted subject:"All messages excluded: double match*"\r
304 > +notmuch tag +test 'subject:All messages excluded: double match: message =\r
305 2'\r
306 > +notmuch tag +test 'subject:All messages excluded: double match: message =\r
307 4'\r
308 > +\r
309 > +# A thread some messages deleted; test only matches a deleted message.\r
310 > +generate_thread "Some messages excluded: single excluded match" 5\r
311 > +notmuch tag +deleted +test 'subject:Some messages excluded: single exclu=\r
312 ded match: message 3'\r
313 > +\r
314 > +# A thread some messages deleted; test only matches a non-deleted messag=\r
315 e.\r
316 > +generate_thread "Some messages excluded: single non-excluded match" 5\r
317 > +notmuch tag +deleted 'subject:Some messages excluded: single non-exclude=\r
318 d match: message 2'\r
319 > +notmuch tag +test 'subject:Some messages excluded: single non-excluded m=\r
320 atch: message 4'\r
321 > +\r
322 > +# A thread no messages deleted; test matches a message.\r
323 > +generate_thread "No messages excluded: single match" 5\r
324 > +notmuch tag +test 'subject:No messages excluded: single match: message 3'\r
325 > +\r
326 > +# Temporarily remove excludes to get list of matching messages\r
327 > +notmuch config set search.exclude_tags\r
328 > +matching_message_ids=3D( `notmuch search --output=3Dmessages tag:test` )\r
329 > +notmuch config set search.exclude_tags deleted\r
330 > +\r
331 > +test_begin_subtest "Default exclusion (thread summary)"\r
332 > +output=3D$(notmuch search tag:test | notmuch_search_sanitize)\r
333 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
334 Suite; Some messages excluded: single non-excluded match: message 4 (delete=\r
335 d inbox test unread)\r
336 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
337 single match: message 3 (inbox test unread)"\r
338 > +\r
339 > +test_begin_subtest "Default exclusion (messages)"\r
340 > +output=3D$(notmuch search --output=3Dmessages tag:test | notmuch_search_=\r
341 sanitize)\r
342 > +test_expect_equal "$output" "${matching_message_ids[4]}\r
343 > +${matching_message_ids[5]}"\r
344 \r
345 Just a thought...  Are we depending on notmuch using a stable sort to\r
346 guarantee this order, given that it's sorting by timestamps with only\r
347 second granularity?  We make this same assumption all over the test\r
348 suite, so I don't think you have to worry about it here, but this hadn't\r
349 occurred to me before.\r
350 \r
351 > +\r
352 > +test_begin_subtest "exclude=3Dtrue (thread summary)"\r
353 > +output=3D$(notmuch search --exclude=3Dtrue tag:test | notmuch_search_san=\r
354 itize)\r
355 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
356 Suite; Some messages excluded: single non-excluded match: message 4 (delete=\r
357 d inbox test unread)\r
358 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
359 single match: message 3 (inbox test unread)"\r
360 > +\r
361 > +test_begin_subtest "exclude=3Dtrue (messages)"\r
362 > +output=3D$(notmuch search --exclude=3Dtrue --output=3Dmessages tag:test =\r
363 | notmuch_search_sanitize)\r
364 > +test_expect_equal "$output" "${matching_message_ids[4]}\r
365 > +${matching_message_ids[5]}"\r
366 > +\r
367 > +test_begin_subtest "exclude=3Dfalse (thread summary)"\r
368 > +output=3D$(notmuch search --exclude=3Dfalse tag:test | notmuch_search_sa=\r
369 nitize)\r
370 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
371 Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
372 nread)\r
373 > +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
374  double match: message 2 (deleted inbox test unread)\r
375 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
376 : single excluded match: message 3 (deleted inbox test unread)\r
377 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
378 : single non-excluded match: message 4 (deleted inbox test unread)\r
379 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
380 single match: message 3 (inbox test unread)"\r
381 > +\r
382 > +test_begin_subtest "exclude=3Dfalse (messages)"\r
383 > +output=3D$(notmuch search --exclude=3Dfalse --output=3Dmessages tag:test=\r
384  | notmuch_search_sanitize)\r
385 > +test_expect_equal "$output" "${matching_message_ids[0]}\r
386 > +${matching_message_ids[1]}\r
387 > +${matching_message_ids[2]}\r
388 > +${matching_message_ids[3]}\r
389 > +${matching_message_ids[4]}\r
390 > +${matching_message_ids[5]}"\r
391 > +\r
392 > +test_begin_subtest "exclude=3Dflag (thread summary)"\r
393 > +output=3D$(notmuch search --exclude=3Dflag tag:test | notmuch_search_san=\r
394 itize)\r
395 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [0/5] Notmuch Test =\r
396 Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
397 nread)\r
398 > +thread:XXX   2001-01-05 [0/5] Notmuch Test Suite; All messages excluded:=\r
399  double match: message 4 (deleted inbox test unread)\r
400 > +thread:XXX   2001-01-05 [0/5] Notmuch Test Suite; Some messages excluded=\r
401 : single excluded match: message 3 (deleted inbox test unread)\r
402 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
403 : single non-excluded match: message 4 (deleted inbox test unread)\r
404 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; No messages excluded: =\r
405 single match: message 3 (inbox test unread)"\r
406 > +\r
407 > +test_begin_subtest "exclude=3Dflag (messages)"\r
408 > +output=3D$(notmuch search --exclude=3Dflag --output=3Dmessages tag:test =\r
409 | notmuch_search_sanitize)\r
410 > +test_expect_equal "$output" "${matching_message_ids[0]}\r
411 > +${matching_message_ids[1]}\r
412 > +${matching_message_ids[2]}\r
413 > +${matching_message_ids[3]}\r
414 > +${matching_message_ids[4]}\r
415 > +${matching_message_ids[5]}"\r
416 > +\r
417 > +test_begin_subtest "Default exclusion: tag in query (thread summary)"\r
418 > +output=3D$(notmuch search tag:test and tag:deleted | notmuch_search_sani=\r
419 tize)\r
420 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
421 Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
422 nread)\r
423 > +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
424  double match: message 2 (deleted inbox test unread)\r
425 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
426 : single excluded match: message 3 (deleted inbox test unread)"\r
427 > +\r
428 > +test_begin_subtest "Default exclusion: tag in query (messages)"\r
429 > +output=3D$(notmuch search --output=3Dmessages tag:test and tag:deleted |=\r
430  notmuch_search_sanitize)\r
431 > +test_expect_equal "$output" "${matching_message_ids[0]}\r
432 > +${matching_message_ids[1]}\r
433 > +${matching_message_ids[2]}\r
434 > +${matching_message_ids[3]}"\r
435 > +\r
436 > +test_begin_subtest "exclude=3Dtrue: tag in query (thread summary)"\r
437 > +output=3D$(notmuch search --exclude=3Dtrue tag:test and tag:deleted | no=\r
438 tmuch_search_sanitize)\r
439 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
440 Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
441 nread)\r
442 > +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
443  double match: message 2 (deleted inbox test unread)\r
444 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
445 : single excluded match: message 3 (deleted inbox test unread)"\r
446 > +\r
447 > +test_begin_subtest "exclude=3Dtrue: tag in query (messages)"\r
448 > +output=3D$(notmuch search --exclude=3Dtrue --output=3Dmessages tag:test =\r
449 and tag:deleted | notmuch_search_sanitize)\r
450 > +test_expect_equal "$output" "${matching_message_ids[0]}\r
451 > +${matching_message_ids[1]}\r
452 > +${matching_message_ids[2]}\r
453 > +${matching_message_ids[3]}"\r
454 > +\r
455 > +test_begin_subtest "exclude=3Dfalse: tag in query (thread summary)"\r
456 > +output=3D$(notmuch search --exclude=3Dfalse tag:test and tag:deleted | n=\r
457 otmuch_search_sanitize)\r
458 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
459 Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
460 nread)\r
461 > +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
462  double match: message 2 (deleted inbox test unread)\r
463 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
464 : single excluded match: message 3 (deleted inbox test unread)"\r
465 > +\r
466 > +test_begin_subtest "exclude=3Dfalse: tag in query (messages)"\r
467 > +output=3D$(notmuch search --exclude=3Dfalse --output=3Dmessages tag:test=\r
468  and tag:deleted | notmuch_search_sanitize)\r
469 > +test_expect_equal "$output" "${matching_message_ids[0]}\r
470 > +${matching_message_ids[1]}\r
471 > +${matching_message_ids[2]}\r
472 > +${matching_message_ids[3]}"\r
473 > +\r
474 > +test_begin_subtest "exclude=3Dflag: tag in query (thread summary)"\r
475 > +output=3D$(notmuch search --exclude=3Dflag tag:test and tag:deleted | no=\r
476 tmuch_search_sanitize)\r
477 > +test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test =\r
478 Suite; All messages excluded: single match: message 2 (deleted inbox test u=\r
479 nread)\r
480 > +thread:XXX   2001-01-05 [2/5] Notmuch Test Suite; All messages excluded:=\r
481  double match: message 2 (deleted inbox test unread)\r
482 > +thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded=\r
483 : single excluded match: message 3 (deleted inbox test unread)"\r
484 > +\r
485 > +test_begin_subtest "exclude=3Dflag: tag in query (messages)"\r
486 > +output=3D$(notmuch search --exclude=3Dflag --output=3Dmessages tag:test =\r
487 and tag:deleted | notmuch_search_sanitize)\r
488 > +test_expect_equal "$output" "${matching_message_ids[0]}\r
489 > +${matching_message_ids[1]}\r
490 > +${matching_message_ids[2]}\r
491 > +${matching_message_ids[3]}"\r
492 > +\r
493 > +\r
494 > +\r
495 > +test_done\r
496 \r
497 Awesome.\r
498 \r
499 > --=20\r
500 > 1.7.9.1\r
501 >\r
502 > _______________________________________________\r
503 > notmuch mailing list\r
504 > notmuch@notmuchmail.org\r
505 > http://notmuchmail.org/mailman/listinfo/notmuch\r