]> git.notmuchmail.org Git - notmuch/blob - test/T140-excludes.sh
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / test / T140-excludes.sh
1 #!/usr/bin/env bash
2 test_description='"notmuch search, count and show" with excludes in several variations'
3 . $(dirname "$0")/test-lib.sh || exit 1
4
5 # Generates a thread consisting of a top level message and 'length'
6 # replies. The subject of the top message 'subject: top message"
7 # and the subject of the nth reply in the thread is "subject: reply n"
8 generate_thread ()
9 {
10     local subject="$1"
11     local length="$2"
12     generate_message '[subject]="'"${subject}: top message"'"' '[body]="'"body of top message"'"'
13     parent_id=$gen_msg_id
14     gen_thread_msg_id[0]=$gen_msg_id
15     for i in `seq 1 $length`
16     do
17         generate_message '[subject]="'"${subject}: reply $i"'"' \
18                          "[in-reply-to]=\<$parent_id\>" \
19                          '[body]="'"body of reply $i"'"'
20         gen_thread_msg_id[$i]=$gen_msg_id
21         parent_id=$gen_msg_id
22     done
23     notmuch new > /dev/null
24     # We cannot retrieve the thread_id until after we have run notmuch new.
25     gen_thread_id=`notmuch search --output=threads id:${gen_thread_msg_id[0]}`
26 }
27
28 #############################################
29 # These are the original search exclude tests.
30
31 test_begin_subtest "Search, exclude \"deleted\" messages from search"
32 notmuch config set search.exclude_tags deleted
33 generate_message '[subject]="Not deleted"'
34 not_deleted_id=$gen_msg_id
35 generate_message '[subject]="Deleted"'
36 notmuch new > /dev/null
37 notmuch tag +deleted id:$gen_msg_id
38 deleted_id=$gen_msg_id
39 output=$(notmuch search subject:deleted | notmuch_search_sanitize)
40 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)"
41
42 test_begin_subtest "Search, exclude \"deleted\" messages; alternate config file"
43 cp ${NOTMUCH_CONFIG} alt-config
44 notmuch config set search.exclude_tags
45 notmuch --config=alt-config search subject:deleted | notmuch_search_sanitize > OUTPUT
46 cp alt-config ${NOTMUCH_CONFIG}
47 cat <<EOF > EXPECTED
48 thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
49 EOF
50 test_expect_equal_file EXPECTED OUTPUT
51
52 test_begin_subtest "Search, exclude \"deleted\" messages from message search"
53 output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize)
54 test_expect_equal "$output" "id:$not_deleted_id"
55
56 test_begin_subtest "Search, exclude \"deleted\" messages from message search --exclude=false"
57 output=$(notmuch search --exclude=false --output=messages subject:deleted | notmuch_search_sanitize)
58 test_expect_equal "$output" "id:$not_deleted_id
59 id:$deleted_id"
60
61 test_begin_subtest "Search, exclude \"deleted\" messages from message search (non-existent exclude-tag)"
62 notmuch config set search.exclude_tags deleted non_existent_tag
63 output=$(notmuch search --output=messages subject:deleted | notmuch_search_sanitize)
64 test_expect_equal "$output" "id:$not_deleted_id"
65 notmuch config set search.exclude_tags deleted
66
67 test_begin_subtest "Search, exclude \"deleted\" messages from search, overridden"
68 output=$(notmuch search subject:deleted and tag:deleted | notmuch_search_sanitize)
69 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Deleted (deleted inbox unread)"
70
71 test_begin_subtest "Search, exclude \"deleted\" messages from threads"
72 add_message '[subject]="Not deleted reply"' '[in-reply-to]="<$gen_msg_id>"'
73 output=$(notmuch search subject:deleted | notmuch_search_sanitize)
74 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
75 thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Not deleted reply (deleted inbox unread)"
76
77 test_begin_subtest "Search, don't exclude \"deleted\" messages when --exclude=flag specified"
78 output=$(notmuch search --exclude=flag subject:deleted | notmuch_search_sanitize)
79 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
80 thread:XXX   2001-01-05 [1/2] Notmuch Test Suite; Deleted (deleted inbox unread)"
81
82 test_begin_subtest "Search, don't exclude \"deleted\" messages from search if not configured"
83 notmuch config set search.exclude_tags
84 output=$(notmuch search subject:deleted | notmuch_search_sanitize)
85 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Not deleted (inbox unread)
86 thread:XXX   2001-01-05 [2/2] Notmuch Test Suite; Deleted (deleted inbox unread)"
87
88
89 ########################################################
90 # We construct some threads for the tests. We use the tag "test" to
91 # indicate which messages we will search for.
92
93 # A thread of deleted messages; test matches one of them.
94 generate_thread "All messages excluded: single match" 5
95 notmuch tag +deleted $gen_thread_id
96 notmuch tag +test id:${gen_thread_msg_id[2]}
97
98 # A thread of deleted messages; test matches two of them.
99 generate_thread "All messages excluded: double match" 5
100 notmuch tag +deleted $gen_thread_id
101 notmuch tag +test id:${gen_thread_msg_id[2]}
102 notmuch tag +test id:${gen_thread_msg_id[4]}
103
104 # A thread some messages deleted; test only matches a deleted message.
105 generate_thread "Some messages excluded: single excluded match" 5
106 notmuch tag +deleted +test id:${gen_thread_msg_id[3]}
107
108 # A thread some messages deleted; test only matches a non-deleted message.
109 generate_thread "Some messages excluded: single non-excluded match" 5
110 notmuch tag +deleted id:${gen_thread_msg_id[2]}
111 notmuch tag +test id:${gen_thread_msg_id[4]}
112
113 # A thread no messages deleted; test matches a message.
114 generate_thread "No messages excluded: single match" 5
115 notmuch tag +test id:${gen_thread_msg_id[3]}
116
117 # Temporarily remove excludes to get list of matching messages
118 notmuch config set search.exclude_tags
119 matching_message_ids=( `notmuch search --output=messages tag:test` )
120 notmuch config set search.exclude_tags deleted
121
122 #########################################
123 # Notmuch search tests
124
125 test_begin_subtest "Search, default exclusion (thread summary)"
126 output=$(notmuch search tag:test | notmuch_search_sanitize)
127 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread)
128 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)"
129
130 test_begin_subtest "Search, default exclusion (messages)"
131 output=$(notmuch search --output=messages tag:test | notmuch_search_sanitize)
132 test_expect_equal "$output" "${matching_message_ids[4]}
133 ${matching_message_ids[5]}"
134
135 test_begin_subtest "Search, exclude=true (thread summary)"
136 output=$(notmuch search --exclude=true tag:test | notmuch_search_sanitize)
137 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread)
138 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)"
139
140 test_begin_subtest "Search, exclude=true (messages)"
141 output=$(notmuch search --exclude=true --output=messages tag:test | notmuch_search_sanitize)
142 test_expect_equal "$output" "${matching_message_ids[4]}
143 ${matching_message_ids[5]}"
144
145 test_begin_subtest "Search, exclude=false (thread summary)"
146 output=$(notmuch search --exclude=false tag:test | notmuch_search_sanitize)
147 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
148 thread:XXX   2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
149 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)
150 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread)
151 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)"
152
153 test_begin_subtest "Search, exclude=false (messages)"
154 output=$(notmuch search --exclude=false --output=messages tag:test | notmuch_search_sanitize)
155 test_expect_equal "$output" "${matching_message_ids[0]}
156 ${matching_message_ids[1]}
157 ${matching_message_ids[2]}
158 ${matching_message_ids[3]}
159 ${matching_message_ids[4]}
160 ${matching_message_ids[5]}"
161
162 test_begin_subtest "Search, exclude=flag (thread summary)"
163 output=$(notmuch search --exclude=flag tag:test | notmuch_search_sanitize)
164 test_expect_equal "$output" "thread:XXX   2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
165 thread:XXX   2001-01-05 [0/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
166 thread:XXX   2001-01-05 [0/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)
167 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (deleted inbox test unread)
168 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)"
169
170 test_begin_subtest "Search, exclude=flag (messages)"
171 output=$(notmuch search --exclude=flag --output=messages tag:test | notmuch_search_sanitize)
172 test_expect_equal "$output" "${matching_message_ids[0]}
173 ${matching_message_ids[1]}
174 ${matching_message_ids[2]}
175 ${matching_message_ids[3]}
176 ${matching_message_ids[4]}
177 ${matching_message_ids[5]}"
178
179 test_begin_subtest "Search, exclude=all (thread summary)"
180 output=$(notmuch search --exclude=all tag:test | notmuch_search_sanitize)
181 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (inbox test unread)
182 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)"
183
184 test_begin_subtest "Search, exclude=all (messages)"
185 output=$(notmuch search --exclude=all --output=messages tag:test | notmuch_search_sanitize)
186 test_expect_equal "$output" "${matching_message_ids[4]}
187 ${matching_message_ids[5]}"
188
189 test_begin_subtest "Search, default exclusion: tag in query (thread summary)"
190 output=$(notmuch search tag:test and tag:deleted | notmuch_search_sanitize)
191 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
192 thread:XXX   2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
193 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)"
194
195 test_begin_subtest "Search, default exclusion: tag in query (messages)"
196 output=$(notmuch search --output=messages tag:test and tag:deleted | notmuch_search_sanitize)
197 test_expect_equal "$output" "${matching_message_ids[0]}
198 ${matching_message_ids[1]}
199 ${matching_message_ids[2]}
200 ${matching_message_ids[3]}"
201
202 test_begin_subtest "Search, exclude=true: tag in query (thread summary)"
203 output=$(notmuch search --exclude=true tag:test and tag:deleted | notmuch_search_sanitize)
204 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
205 thread:XXX   2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
206 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)"
207
208 test_begin_subtest "Search, exclude=true: tag in query (messages)"
209 output=$(notmuch search --exclude=true --output=messages tag:test and tag:deleted | notmuch_search_sanitize)
210 test_expect_equal "$output" "${matching_message_ids[0]}
211 ${matching_message_ids[1]}
212 ${matching_message_ids[2]}
213 ${matching_message_ids[3]}"
214
215 test_begin_subtest "Search, exclude=false: tag in query (thread summary)"
216 output=$(notmuch search --exclude=false tag:test and tag:deleted | notmuch_search_sanitize)
217 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
218 thread:XXX   2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
219 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)"
220
221 test_begin_subtest "Search, exclude=false: tag in query (messages)"
222 output=$(notmuch search --exclude=false --output=messages tag:test and tag:deleted | notmuch_search_sanitize)
223 test_expect_equal "$output" "${matching_message_ids[0]}
224 ${matching_message_ids[1]}
225 ${matching_message_ids[2]}
226 ${matching_message_ids[3]}"
227
228 test_begin_subtest "Search, exclude=flag: tag in query (thread summary)"
229 output=$(notmuch search --exclude=flag tag:test and tag:deleted | notmuch_search_sanitize)
230 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
231 thread:XXX   2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
232 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)"
233
234 test_begin_subtest "Search, exclude=flag: tag in query (messages)"
235 output=$(notmuch search --exclude=flag --output=messages tag:test and tag:deleted | notmuch_search_sanitize)
236 test_expect_equal "$output" "${matching_message_ids[0]}
237 ${matching_message_ids[1]}
238 ${matching_message_ids[2]}
239 ${matching_message_ids[3]}"
240
241 test_begin_subtest "Search, exclude=all: tag in query (thread summary)"
242 output=$(notmuch search --exclude=all tag:test and tag:deleted | notmuch_search_sanitize)
243 test_expect_equal "$output" "thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread)
244 thread:XXX   2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread)
245 thread:XXX   2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)"
246
247 test_begin_subtest "Search, exclude=all: tag in query (messages)"
248 output=$(notmuch search --exclude=all --output=messages tag:test and tag:deleted | notmuch_search_sanitize)
249 test_expect_equal "$output" "${matching_message_ids[0]}
250 ${matching_message_ids[1]}
251 ${matching_message_ids[2]}
252 ${matching_message_ids[3]}"
253
254 #########################################################
255 # Notmuch count tests
256
257 test_begin_subtest "Count, default exclusion (messages)"
258 output=$(notmuch count tag:test)
259 test_expect_equal "$output" "2"
260
261 test_begin_subtest "Count, default exclusion (threads)"
262 output=$(notmuch count --output=threads tag:test)
263 test_expect_equal "$output" "2"
264
265 test_begin_subtest "Count, exclude=true (messages)"
266 output=$(notmuch count --exclude=true tag:test)
267 test_expect_equal "$output" "2"
268
269 test_begin_subtest "Count, exclude=true (threads)"
270 output=$(notmuch count --output=threads --exclude=true tag:test)
271 test_expect_equal "$output" "2"
272
273 test_begin_subtest "Count, exclude=false (messages)"
274 output=$(notmuch count --exclude=false tag:test)
275 test_expect_equal "$output" "6"
276
277 test_begin_subtest "Count, exclude=false (threads)"
278 output=$(notmuch count --output=threads --exclude=false tag:test)
279 test_expect_equal "$output" "5"
280
281 test_begin_subtest "Count, default exclusion: tag in query (messages)"
282 output=$(notmuch count tag:test and tag:deleted)
283 test_expect_equal "$output" "4"
284
285 test_begin_subtest "Count, default exclusion: tag in query (threads)"
286 output=$(notmuch count --output=threads tag:test and tag:deleted)
287 test_expect_equal "$output" "3"
288
289 test_begin_subtest "Count, default exclusion, batch"
290 notmuch count  --batch --output=messages<<EOF > OUTPUT
291 tag:test
292 tag:test and tag:deleted
293 tag:test
294 tag:test and tag:deleted
295 EOF
296 cat <<EOF >EXPECTED
297 2
298 4
299 2
300 4
301 EOF
302 test_expect_equal_file EXPECTED OUTPUT
303
304 test_begin_subtest "Count, exclude=true: tag in query (messages)"
305 output=$(notmuch count --exclude=true tag:test and tag:deleted)
306 test_expect_equal "$output" "4"
307
308 test_begin_subtest "Count, exclude=true: tag in query (threads)"
309 output=$(notmuch count --output=threads --exclude=true tag:test and tag:deleted)
310 test_expect_equal "$output" "3"
311
312 test_begin_subtest "Count, exclude=false: tag in query (messages)"
313 output=$(notmuch count --exclude=false tag:test and tag:deleted)
314 test_expect_equal "$output" "4"
315
316 test_begin_subtest "Count, exclude=false: tag in query (threads)"
317 output=$(notmuch count --output=threads --exclude=false tag:test and tag:deleted)
318 test_expect_equal "$output" "3"
319
320 #############################################################
321 # Show tests
322
323 test_begin_subtest "Show, default exclusion"
324 output=$(notmuch show tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
325 test_expect_equal "$output" "\fmessage{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
326 Subject: Some messages excluded: single non-excluded match: reply 4
327 \fmessage{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
328 Subject: No messages excluded: single match: reply 3"
329
330 test_begin_subtest "Show, default exclusion (entire-thread)"
331 output=$(notmuch show --entire-thread tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
332 test_expect_equal "$output" "\fmessage{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX
333 Subject: Some messages excluded: single non-excluded match: top message
334 \fmessage{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX
335 Subject: Some messages excluded: single non-excluded match: reply 1
336 \fmessage{ id:XXXXX depth:2 match:0 excluded:1 filename:XXXXX
337 Subject: Some messages excluded: single non-excluded match: reply 2
338 \fmessage{ id:XXXXX depth:3 match:0 excluded:0 filename:XXXXX
339 Subject: Some messages excluded: single non-excluded match: reply 3
340 \fmessage{ id:XXXXX depth:4 match:1 excluded:0 filename:XXXXX
341 Subject: Some messages excluded: single non-excluded match: reply 4
342 \fmessage{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX
343 Subject: Some messages excluded: single non-excluded match: reply 5
344 \fmessage{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX
345 Subject: No messages excluded: single match: top message
346 \fmessage{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX
347 Subject: No messages excluded: single match: reply 1
348 \fmessage{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX
349 Subject: No messages excluded: single match: reply 2
350 \fmessage{ id:XXXXX depth:3 match:1 excluded:0 filename:XXXXX
351 Subject: No messages excluded: single match: reply 3
352 \fmessage{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX
353 Subject: No messages excluded: single match: reply 4
354 \fmessage{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX
355 Subject: No messages excluded: single match: reply 5"
356
357 test_begin_subtest "Show, exclude=true"
358 output=$(notmuch show --exclude=true tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
359 test_expect_equal "$output" "\fmessage{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
360 Subject: Some messages excluded: single non-excluded match: reply 4
361 \fmessage{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
362 Subject: No messages excluded: single match: reply 3"
363
364 test_begin_subtest "Show, exclude=true (entire-thread)"
365 output=$(notmuch show --entire-thread --exclude=true tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
366 test_expect_equal "$output" "\fmessage{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX
367 Subject: Some messages excluded: single non-excluded match: top message
368 \fmessage{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX
369 Subject: Some messages excluded: single non-excluded match: reply 1
370 \fmessage{ id:XXXXX depth:2 match:0 excluded:1 filename:XXXXX
371 Subject: Some messages excluded: single non-excluded match: reply 2
372 \fmessage{ id:XXXXX depth:3 match:0 excluded:0 filename:XXXXX
373 Subject: Some messages excluded: single non-excluded match: reply 3
374 \fmessage{ id:XXXXX depth:4 match:1 excluded:0 filename:XXXXX
375 Subject: Some messages excluded: single non-excluded match: reply 4
376 \fmessage{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX
377 Subject: Some messages excluded: single non-excluded match: reply 5
378 \fmessage{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX
379 Subject: No messages excluded: single match: top message
380 \fmessage{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX
381 Subject: No messages excluded: single match: reply 1
382 \fmessage{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX
383 Subject: No messages excluded: single match: reply 2
384 \fmessage{ id:XXXXX depth:3 match:1 excluded:0 filename:XXXXX
385 Subject: No messages excluded: single match: reply 3
386 \fmessage{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX
387 Subject: No messages excluded: single match: reply 4
388 \fmessage{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX
389 Subject: No messages excluded: single match: reply 5"
390
391 test_begin_subtest "Show, exclude=false"
392 output=$(notmuch show --exclude=false tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
393 test_expect_equal "$output" "\fmessage{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX
394 Subject: All messages excluded: single match: reply 2
395 \fmessage{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX
396 Subject: All messages excluded: double match: reply 2
397 \fmessage{ id:XXXXX depth:1 match:1 excluded:1 filename:XXXXX
398 Subject: All messages excluded: double match: reply 4
399 \fmessage{ id:XXXXX depth:0 match:1 excluded:1 filename:XXXXX
400 Subject: Some messages excluded: single excluded match: reply 3
401 \fmessage{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
402 Subject: Some messages excluded: single non-excluded match: reply 4
403 \fmessage{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
404 Subject: No messages excluded: single match: reply 3"
405
406 test_begin_subtest "Show, exclude=false (entire-thread)"
407 output=$(notmuch show --entire-thread --exclude=false tag:test | notmuch_show_sanitize_all | egrep "Subject:|message{")
408 test_expect_equal "$output" "\fmessage{ id:XXXXX depth:0 match:0 excluded:1 filename:XXXXX
409 Subject: All messages excluded: single match: top message
410 \fmessage{ id:XXXXX depth:1 match:0 excluded:1 filename:XXXXX
411 Subject: All messages excluded: single match: reply 1
412 \fmessage{ id:XXXXX depth:2 match:1 excluded:1 filename:XXXXX
413 Subject: All messages excluded: single match: reply 2
414 \fmessage{ id:XXXXX depth:3 match:0 excluded:1 filename:XXXXX
415 Subject: All messages excluded: single match: reply 3
416 \fmessage{ id:XXXXX depth:4 match:0 excluded:1 filename:XXXXX
417 Subject: All messages excluded: single match: reply 4
418 \fmessage{ id:XXXXX depth:5 match:0 excluded:1 filename:XXXXX
419 Subject: All messages excluded: single match: reply 5
420 \fmessage{ id:XXXXX depth:0 match:0 excluded:1 filename:XXXXX
421 Subject: All messages excluded: double match: top message
422 \fmessage{ id:XXXXX depth:1 match:0 excluded:1 filename:XXXXX
423 Subject: All messages excluded: double match: reply 1
424 \fmessage{ id:XXXXX depth:2 match:1 excluded:1 filename:XXXXX
425 Subject: All messages excluded: double match: reply 2
426 \fmessage{ id:XXXXX depth:3 match:0 excluded:1 filename:XXXXX
427 Subject: All messages excluded: double match: reply 3
428 \fmessage{ id:XXXXX depth:4 match:1 excluded:1 filename:XXXXX
429 Subject: All messages excluded: double match: reply 4
430 \fmessage{ id:XXXXX depth:5 match:0 excluded:1 filename:XXXXX
431 Subject: All messages excluded: double match: reply 5
432 \fmessage{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX
433 Subject: Some messages excluded: single excluded match: top message
434 \fmessage{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX
435 Subject: Some messages excluded: single excluded match: reply 1
436 \fmessage{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX
437 Subject: Some messages excluded: single excluded match: reply 2
438 \fmessage{ id:XXXXX depth:3 match:1 excluded:1 filename:XXXXX
439 Subject: Some messages excluded: single excluded match: reply 3
440 \fmessage{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX
441 Subject: Some messages excluded: single excluded match: reply 4
442 \fmessage{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX
443 Subject: Some messages excluded: single excluded match: reply 5
444 \fmessage{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX
445 Subject: Some messages excluded: single non-excluded match: top message
446 \fmessage{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX
447 Subject: Some messages excluded: single non-excluded match: reply 1
448 \fmessage{ id:XXXXX depth:2 match:0 excluded:1 filename:XXXXX
449 Subject: Some messages excluded: single non-excluded match: reply 2
450 \fmessage{ id:XXXXX depth:3 match:0 excluded:0 filename:XXXXX
451 Subject: Some messages excluded: single non-excluded match: reply 3
452 \fmessage{ id:XXXXX depth:4 match:1 excluded:0 filename:XXXXX
453 Subject: Some messages excluded: single non-excluded match: reply 4
454 \fmessage{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX
455 Subject: Some messages excluded: single non-excluded match: reply 5
456 \fmessage{ id:XXXXX depth:0 match:0 excluded:0 filename:XXXXX
457 Subject: No messages excluded: single match: top message
458 \fmessage{ id:XXXXX depth:1 match:0 excluded:0 filename:XXXXX
459 Subject: No messages excluded: single match: reply 1
460 \fmessage{ id:XXXXX depth:2 match:0 excluded:0 filename:XXXXX
461 Subject: No messages excluded: single match: reply 2
462 \fmessage{ id:XXXXX depth:3 match:1 excluded:0 filename:XXXXX
463 Subject: No messages excluded: single match: reply 3
464 \fmessage{ id:XXXXX depth:4 match:0 excluded:0 filename:XXXXX
465 Subject: No messages excluded: single match: reply 4
466 \fmessage{ id:XXXXX depth:5 match:0 excluded:0 filename:XXXXX
467 Subject: No messages excluded: single match: reply 5"
468
469
470 test_done