3 test_description="emacs interface"
6 EXPECTED=$TEST_DIRECTORY/emacs.expected-output
10 test_begin_subtest "Basic notmuch-hello view in emacs"
11 test_emacs '(notmuch-hello)
13 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello
15 test_begin_subtest "Saved search with 0 results"
16 test_emacs '(let ((notmuch-show-empty-saved-searches t)
17 (notmuch-saved-searches
18 '\''(("inbox" . "tag:inbox")
19 ("unread" . "tag:unread")
20 ("empty" . "tag:doesnotexist"))))
23 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-with-empty
25 test_begin_subtest "No saved searches displayed (all with 0 results)"
26 test_emacs '(let ((notmuch-saved-searches
27 '\''(("empty" . "tag:doesnotexist"))))
30 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
32 test_begin_subtest "Basic notmuch-search view in emacs"
33 test_emacs '(notmuch-search "tag:inbox")
36 test_expect_equal_file OUTPUT $EXPECTED/notmuch-search-tag-inbox
38 test_begin_subtest "Navigation of notmuch-hello to search results"
39 test_emacs '(notmuch-hello)
40 (goto-char (point-min))
41 (re-search-forward "inbox")
42 (widget-button-press (point))
45 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-view-inbox
47 test_begin_subtest "Basic notmuch-show view in emacs"
48 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
49 test_emacs "(notmuch-show \"$maildir_storage_thread\")
51 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
53 test_begin_subtest "Basic notmuch-show view in emacs default indentation"
54 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
55 test_emacs "(let ((notmuch-show-indent-messages-width 1))
56 (notmuch-show \"$maildir_storage_thread\")
58 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
60 test_begin_subtest "Basic notmuch-show view in emacs without indentation"
61 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
62 test_emacs "(let ((notmuch-show-indent-messages-width 0))
63 (notmuch-show \"$maildir_storage_thread\")
65 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation
67 test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation"
68 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
69 test_emacs "(let ((notmuch-show-indent-messages-width 4))
70 (notmuch-show \"$maildir_storage_thread\")
72 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation
74 test_begin_subtest "notmuch-show for message with invalid From"
75 add_message "[subject]=\"message-with-invalid-from\"" \
76 "[from]=\"\\\"Invalid \\\" From\\\" <test_suite@notmuchmail.org>\""
77 thread=$(notmuch search --output=threads subject:message-with-invalid-from)
78 test_emacs "(notmuch-show \"$thread\")
81 "Invalid " (2001-01-05) (inbox)
82 Subject: message-with-invalid-from
83 To: Notmuch Test Suite <test_suite@notmuchmail.org>
84 Date: Fri, 05 Jan 2001 15:43:57 +0000
86 This is just a test message (#1)
88 test_expect_equal_file OUTPUT EXPECTED
90 test_begin_subtest "Navigation of notmuch-search to thread view"
91 test_emacs '(notmuch-search "tag:inbox")
93 (goto-char (point-min))
94 (re-search-forward "Working with Maildir")
95 (notmuch-search-show-thread)
98 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
100 test_begin_subtest "Add tag from search view"
101 os_x_darwin_thread=$(notmuch search --output=threads id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com)
102 test_emacs "(notmuch-search \"$os_x_darwin_thread\")
104 (execute-kbd-macro \"+tag-from-search-view\")"
105 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
106 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-search-view unread)"
108 test_begin_subtest "Remove tag from search view"
109 test_emacs "(notmuch-search \"$os_x_darwin_thread\")
111 (execute-kbd-macro \"-tag-from-search-view\")"
112 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
113 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"
115 test_begin_subtest "Add tag from notmuch-show view"
116 test_emacs "(notmuch-show \"$os_x_darwin_thread\")
117 (execute-kbd-macro \"+tag-from-show-view\")"
118 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
119 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox tag-from-show-view unread)"
121 test_begin_subtest "Remove tag from notmuch-show view"
122 test_emacs "(notmuch-show \"$os_x_darwin_thread\")
123 (execute-kbd-macro \"-tag-from-show-view\")"
124 output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)
125 test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"
127 test_begin_subtest "Message with .. in Message-Id:"
128 add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'
129 test_emacs '(notmuch-search "id:\"123..456@example\"")
131 (execute-kbd-macro "+search-add")
132 (execute-kbd-macro "+search-remove")
133 (execute-kbd-macro "-search-remove")
134 (notmuch-show "id:\"123..456@example\"")
136 (execute-kbd-macro "+show-add")
137 (execute-kbd-macro "+show-remove")
138 (execute-kbd-macro "-show-remove")'
139 output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)
140 test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)"
142 test_begin_subtest "Sending a message via (fake) SMTP"
143 emacs_deliver_message \
144 'Testing message sent via SMTP' \
145 'This is a test that messages are sent via SMTP' \
148 (insert "To: user@example.com\n")'
150 -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \
151 -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' < sent_message >OUTPUT
153 From: Notmuch Test Suite <test_suite@notmuchmail.org>
155 Subject: Testing message sent via SMTP
156 Date: 01 Jan 2000 12:00:00 -0000
157 User-Agent: Notmuch/XXX Emacs/XXX
160 Content-Type: text/plain; charset=us-ascii
162 This is a test that messages are sent via SMTP
164 test_expect_equal_file OUTPUT EXPECTED
166 test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)"
167 notmuch new > /dev/null
168 output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)
169 test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"
171 test_begin_subtest "notmuch-fcc-dirs set to nil"
172 test_emacs "(let ((notmuch-fcc-dirs nil))
176 From: Notmuch Test Suite <test_suite@notmuchmail.org>
179 --text follows this line--
181 test_expect_equal_file OUTPUT EXPECTED
183 # Make another FCC maildir specific for the next test
184 mkdir -p mail/sent-string/cur
185 mkdir -p mail/sent-string/new
186 mkdir -p mail/sent-string/tmp
188 test_begin_subtest "notmuch-fcc-dirs set to a string"
189 test_emacs "(let ((notmuch-fcc-dirs \"sent-string\"))
193 From: Notmuch Test Suite <test_suite@notmuchmail.org>
196 Fcc: ${MAIL_DIR}/sent-string
197 --text follows this line--
199 test_expect_equal_file OUTPUT EXPECTED
201 # Make more FCC maildirs specific for the next test
202 mkdir -p mail/sent-list-match/cur
203 mkdir -p mail/sent-list-match/new
204 mkdir -p mail/sent-list-match/tmp
205 mkdir -p mail/failure/cur
206 mkdir -p mail/failure/new
207 mkdir -p mail/failure/tmp
209 test_begin_subtest "notmuch-fcc-dirs set to a list (with match)"
210 test_emacs "(let ((notmuch-fcc-dirs
211 '((\"notmuchmail.org\" . \"sent-list-match\")
212 (\".*\" . \"failure\"))))
216 From: Notmuch Test Suite <test_suite@notmuchmail.org>
219 Fcc: ${MAIL_DIR}/sent-list-match
220 --text follows this line--
222 test_expect_equal_file OUTPUT EXPECTED
224 # Make another FCC maildir specific for the next test
225 mkdir -p mail/sent-list-catch-all/cur
226 mkdir -p mail/sent-list-catch-all/new
227 mkdir -p mail/sent-list-catch-all/tmp
229 test_begin_subtest "notmuch-fcc-dirs set to a list (catch-all)"
230 test_emacs "(let ((notmuch-fcc-dirs
231 '((\"example.com\" . \"failure\")
232 (\".*\" . \"sent-list-catch-all\"))))
236 From: Notmuch Test Suite <test_suite@notmuchmail.org>
239 Fcc: ${MAIL_DIR}/sent-list-catch-all
240 --text follows this line--
242 test_expect_equal_file OUTPUT EXPECTED
244 test_begin_subtest "notmuch-fcc-dirs set to a list (no match)"
245 test_emacs "(let ((notmuch-fcc-dirs
246 '((\"example.com\" . \"failure\")
247 (\"nomatchhere.net\" . \"failure\"))))
251 From: Notmuch Test Suite <test_suite@notmuchmail.org>
254 --text follows this line--
256 test_expect_equal_file OUTPUT EXPECTED
258 test_begin_subtest "Reply within emacs"
259 test_emacs '(notmuch-search "subject:\"testing message sent via SMTP\"")
261 (notmuch-search-reply-to-thread)
263 sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT
265 From: Notmuch Test Suite <test_suite@notmuchmail.org>
267 Subject: Re: Testing message sent via SMTP
269 Fcc: ${MAIL_DIR}/sent
270 --text follows this line--
271 Notmuch Test Suite <test_suite@notmuchmail.org> writes:
273 > This is a test that messages are sent via SMTP
275 test_expect_equal_file OUTPUT EXPECTED
277 test_begin_subtest "Reply within emacs to a multipart/mixed message"
278 test_emacs '(notmuch-show "id:20091118002059.067214ed@hikari")
282 From: Notmuch Test Suite <test_suite@notmuchmail.org>
283 To: Adrian Perez de Castro <aperez@igalia.com>, notmuch@notmuchmail.org
284 Subject: Re: [notmuch] Introducing myself
285 In-Reply-To: <20091118002059.067214ed@hikari>
286 Fcc: ${MAIL_DIR}/sent
287 --text follows this line--
288 Adrian Perez de Castro <aperez@igalia.com> writes:
292 > I have just heard about Not Much today in some random Linux-related news
293 > site (LWN?), my name is Adrian Perez and I work as systems administrator
294 > (although I can do some code as well :P). I have always thought that the
295 > ideas behind Sup were great, but after some time using it, I got tired of
296 > the oddities that it has. I also do not like doing things like having to
297 > install Ruby just for reading and sorting mails. Some time ago I thought
298 > about doing something like Not Much and in fact I played a bit with the
299 > Python+Xapian and the Python+Whoosh combinations, because I find relaxing
300 > to code things in Python when I am not working and also it is installed
301 > by default on most distribution. I got to have some mailboxes indexed and
302 > basic searching working a couple of months ago. Lately I have been very
303 > busy and had no time for coding, and them... boom! Not Much appears -- and
304 > it is almost exactly what I was trying to do, but faster. I have been
305 > playing a bit with Not Much today, and I think it has potential.
307 > Also, I would like to share one idea I had in mind, that you might find
308 > interesting: One thing I have found very annoying is having to re-tag my
309 > mail when the indexes get b0rked (it happened a couple of times to me while
310 > using Sup), so I was planning to mails as read/unread and adding the tags
311 > not just to the index, but to the mail text itself, e.g. by adding a
312 > "X-Tags" header field or by reusing the "Keywords" one. This way, the index
313 > could be totally recreated by re-reading the mail directories, and this
314 > would also allow to a tools like OfflineIMAP [1] to get the mails into a
315 > local maildir, tagging and indexing the mails with the e-mail reader and
316 > then syncing back the messages with the "X-Tags" header to the IMAP server.
317 > This would allow to use the mail reader from a different computer and still
318 > have everything tagged finely.
324 > [1] http://software.complete.org/software/projects/show/offlineimap
327 > Adrian Perez de Castro <aperez@igalia.com>
328 > Igalia - Free Software Engineering
329 > _______________________________________________
330 > notmuch mailing list
331 > notmuch@notmuchmail.org
332 > http://notmuchmail.org/mailman/listinfo/notmuch
334 test_expect_equal_file OUTPUT EXPECTED
336 test_begin_subtest "Reply within emacs to a multipart/alternative message"
337 test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
341 From: Notmuch Test Suite <test_suite@notmuchmail.org>
342 To: Alex Botero-Lowry <alex.boterolowry@gmail.com>, notmuch@notmuchmail.org
343 Subject: Re: [notmuch] preliminary FreeBSD support
344 In-Reply-To: <cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com>
345 Fcc: ${MAIL_DIR}/sent
346 --text follows this line--
347 Alex Botero-Lowry <alex.boterolowry@gmail.com> writes:
349 > I saw the announcement this morning, and was very excited, as I had been
350 > hoping sup would be turned into a library,
351 > since I like the concept more than the UI (I'd rather an emacs interface).
353 > I did a preliminary compile which worked out fine, but
354 > sysconf(_SC_SC_GETPW_R_SIZE_MAX) returns -1 on
355 > FreeBSD, so notmuch_config_open segfaulted.
357 > Attached is a patch that supplies a default buffer size of 64 in cases where
360 > http://www.opengroup.org/austin/docs/austin_328.txt - seems to indicate this
361 > is acceptable behavior,
362 > and http://mail-index.netbsd.org/pkgsrc-bugs/2006/06/07/msg016808.htmlspecifically
365 > _______________________________________________
366 > notmuch mailing list
367 > notmuch@notmuchmail.org
368 > http://notmuchmail.org/mailman/listinfo/notmuch
370 test_expect_equal_file OUTPUT EXPECTED
372 test_begin_subtest "Quote MML tags in reply"
373 message_id='test-emacs-mml-quoting@message.id'
374 add_message [id]="$message_id" \
375 "[subject]='$test_subtest_name'" \
376 '[body]="<#part disposition=inline>"'
377 test_emacs "(notmuch-show \"id:$message_id\")
381 From: Notmuch Test Suite <test_suite@notmuchmail.org>
383 Subject: Re: Quote MML tags in reply
384 In-Reply-To: <test-emacs-mml-quoting@message.id>
385 Fcc: ${MAIL_DIR}/sent
386 --text follows this line--
387 Notmuch Test Suite <test_suite@notmuchmail.org> writes:
389 > <#!part disposition=inline>
391 test_expect_equal_file OUTPUT EXPECTED
393 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-attachments"
394 # save as archive to test that Emacs does not re-compress .gz
395 test_emacs '(let ((standard-input "\"attachment1.gz\""))
396 (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
397 (notmuch-show-save-attachments))'
398 test_expect_equal_file attachment1.gz "$EXPECTED/attachment"
400 test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part"
401 # save as archive to test that Emacs does not re-compress .gz
402 test_emacs '(let ((standard-input "\"attachment2.gz\""))
403 (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))'
404 test_expect_equal_file attachment2.gz "$EXPECTED/attachment"
406 test_begin_subtest "View raw message within emacs"
407 test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com")
408 (notmuch-show-view-raw-message)
410 test_expect_equal_file OUTPUT $EXPECTED/raw-message-cf0c4d-52ad0a
412 test_begin_subtest "Hiding/showing signature in notmuch-show view"
413 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
414 test_emacs "(notmuch-show \"$maildir_storage_thread\")
415 (search-forward \"Click/Enter to show.\")
416 (button-activate (button-at (point)))
417 (search-backward \"Click/Enter to hide.\")
418 (button-activate (button-at (point)))
420 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage
422 test_begin_subtest "Detection and hiding of top-post quoting of message"
423 add_message '[subject]="The problem with top-posting"' \
424 [id]=top-post-target \
425 '[body]="A: Because it messes up the order in which people normally read text.
426 Q: Why is top-posting such a bad thing?
428 Q: What is the most annoying thing in e-mail?"'
429 add_message '[from]="Top Poster <top@poster.com>"' \
430 [in-reply-to]=top-post-target \
431 [references]=top-post-target \
432 '[subject]="Re: The problem with top-posting"' \
433 '[body]="Thanks for the advice! I will be sure to put it to good use.
437 ----- Original Message -----
438 From: Notmuch Test Suite <test_suite@notmuchmail.org>
439 To: Notmuch Test Suite <test_suite@notmuchmai.org>
440 Sent: Fri, 05 Jan 2001 15:43:57 +0000
441 Subject: The problem with top-posting
443 Q: Why is top-posting such a bad thing?
445 Q: What is the most annoying thing in e-mail?"'
446 test_emacs "(notmuch-show \"top-posting\")
447 (test-visible-output)"
448 echo "Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
449 Subject: The problem with top-posting
450 To: Notmuch Test Suite <test_suite@notmuchmail.org>
451 Date: Fri, 05 Jan 2001 15:43:57 +0000
453 A: Because it messes up the order in which people normally read text.
454 Q: Why is top-posting such a bad thing?
456 Q: What is the most annoying thing in e-mail?
457 Top Poster <top@poster.com> (2001-01-05) (inbox unread)
458 Subject: Re: The problem with top-posting
459 To: Notmuch Test Suite <test_suite@notmuchmail.org>
460 Date: Fri, 05 Jan 2001 15:43:57 +0000
462 Thanks for the advice! I will be sure to put it to good use.
466 [ 9-line hidden original message. Click/Enter to show. ]" > EXPECTED
467 test_expect_equal_file OUTPUT EXPECTED
469 test_begin_subtest "Hiding message in notmuch-show view"
470 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
471 (notmuch-show-toggle-message)
472 (test-visible-output)'
473 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
475 test_begin_subtest "Hiding message with visible citation in notmuch-show view"
476 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
477 (search-forward "Click/Enter to show.")
478 (button-activate (button-at (point)))
479 (notmuch-show-toggle-message)
480 (test-visible-output)'
481 test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages
483 test_begin_subtest "Stashing in notmuch-show"
484 add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \
485 '[from]="Some One <someone@somewhere.org>"' \
486 '[to]="Some One Else <notsomeone@somewhere.org>"' \
487 '[cc]="Notmuch <notmuch@notmuchmail.org>"' \
488 '[subject]="Stash my stashables"' \
490 '[body]="Unable to stash body. Where did you get it in the first place?!?"'
491 notmuch tag +stashtest id:${gen_msg_id}
492 test_emacs '(notmuch-show "id:\"bought\"")
493 (notmuch-show-stash-date)
494 (notmuch-show-stash-from)
495 (notmuch-show-stash-to)
496 (notmuch-show-stash-cc)
497 (notmuch-show-stash-subject)
498 (notmuch-show-stash-message-id)
499 (notmuch-show-stash-message-id-stripped)
500 (notmuch-show-stash-tags)
501 (notmuch-show-stash-filename)
502 (notmuch-show-stash-mlarchive-link "Gmane")
503 (notmuch-show-stash-mlarchive-link "MARC")
504 (notmuch-show-stash-mlarchive-link "Mail Archive, The")
506 (generate-new-buffer "*test-stashing*"))
510 (rotate-yank-pointer 1))
511 (reverse-region (point-min) (point-max))
514 Sat, 01 Jan 2000 12:00:00 +0000
515 Some One <someone@somewhere.org>
516 Some One Else <notsomeone@somewhere.org>
517 Notmuch <notmuch@notmuchmail.org>
523 http://mid.gmane.org/bought
524 http://marc.info/?i=bought
525 http://mail-archive.com/search?l=mid&q=bought
527 test_expect_equal_file OUTPUT EXPECTED
529 test_begin_subtest "Stashing in notmuch-search"
530 test_emacs '(notmuch-search "id:\"bought\"")
532 (notmuch-search-stash-thread-id)
534 (generate-new-buffer "*test-stashing*"))
537 sed -i -e 's/^thread:.*$/thread:XXX/' OUTPUT
538 test_expect_equal "$(cat OUTPUT)" "thread:XXX"
540 test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature'
541 message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu'
542 message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net'
543 test_emacs "(notmuch-search \"$message1 or $message2\")
545 (notmuch-search-show-thread)
546 (goto-char (point-max))
548 (notmuch-show-advance-and-archive)
550 test_emacs "(notmuch-show \"$message2\")
551 (test-output \"EXPECTED\")"
552 test_expect_equal_file OUTPUT EXPECTED
554 test_begin_subtest "Refresh show buffer"
555 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
556 (test-visible-output "EXPECTED")
557 (notmuch-show-refresh-view)
558 (test-visible-output)'
559 test_expect_equal_file OUTPUT EXPECTED
561 test_begin_subtest "Refresh modified show buffer"
562 test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com")
563 (notmuch-show-toggle-message)
564 (notmuch-show-next-message)
565 (notmuch-show-toggle-message)
566 (test-visible-output "EXPECTED")
567 (notmuch-show-refresh-view)
568 (test-visible-output)'
569 test_expect_equal_file OUTPUT EXPECTED
571 test_begin_subtest "Do not call notmuch for non-inlinable application/mpeg parts"
572 id='message-with-application/mpeg-attachment@notmuchmail.org'
573 emacs_deliver_message \
574 'Message with application/mpeg attachment' \
577 (insert \"Message-ID: <$id>\n\")
579 (mml-insert-part \"application/mpeg\")
580 (insert \"a fake mp3 file\")"
581 notmuch_counter_reset
582 test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))
583 (notmuch-show \"id:$id\"))"
584 test_expect_equal $(notmuch_counter_value) 1
586 test_begin_subtest "Do not call notmuch for non-inlinable audio/mpeg parts"
587 id='message-with-audio/mpeg-attachment@notmuchmail.org'
588 emacs_deliver_message \
589 'Message with audio/mpeg attachment' \
592 (insert \"Message-ID: <$id>\n\")
594 (mml-insert-part \"audio/mpeg\")
595 (insert \"a fake mp3 file\")"
596 notmuch_counter_reset
597 test_emacs "(let ((notmuch-command \"$notmuch_counter_command\"))
598 (notmuch-show \"id:$id\"))"
599 test_expect_equal $(notmuch_counter_value) 1
601 test_begin_subtest "notmuch-hello-mode hook is called"
602 counter=$(test_emacs \
603 '(let ((notmuch-hello-mode-hook-counter 0))
604 (kill-buffer "*notmuch-hello*")
606 notmuch-hello-mode-hook-counter)'
608 test_expect_equal "$counter" 1
610 test_begin_subtest "notmuch-hello-mode hook is not called on updates"
611 counter=$(test_emacs \
612 '(let ((notmuch-hello-mode-hook-counter 0))
613 (kill-buffer "*notmuch-hello*")
615 (notmuch-hello-update)
616 notmuch-hello-mode-hook-counter)'
618 test_expect_equal "$counter" 1
620 test_begin_subtest "notmuch-hello-refresh hook is called"
621 counter=$(test_emacs \
622 '(let ((notmuch-hello-refresh-hook-counter 0))
623 (kill-buffer "*notmuch-hello*")
625 notmuch-hello-refresh-hook-counter)'
627 test_expect_equal "$counter" 1
629 test_begin_subtest "notmuch-hello-refresh hook is called on updates"
630 counter=$(test_emacs \
631 '(let ((notmuch-hello-refresh-hook-counter 0))
632 (kill-buffer "*notmuch-hello*")
634 (notmuch-hello-update)
635 notmuch-hello-refresh-hook-counter)'
637 test_expect_equal "$counter" 2