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