X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Femacs;h=ac47b161f837be4f325101c8305ab499867e376f;hp=3f8c72d34e1afa16220bf8932dea7d09c74c7d0a;hb=0bbfc5ce8be91b881d9542d86aceec7e6a716e86;hpb=6cb61729d46335b5ad6ee5e2f618b48fbabda218 diff --git a/test/emacs b/test/emacs index 3f8c72d3..ac47b161 100755 --- a/test/emacs +++ b/test/emacs @@ -52,21 +52,21 @@ test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage test_begin_subtest "Basic notmuch-show view in emacs default indentation" maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) -test_emacs "(let ((notmuch-indent-messages-width 1)) +test_emacs "(let ((notmuch-show-indent-messages-width 1)) (notmuch-show \"$maildir_storage_thread\") (test-output))" test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage test_begin_subtest "Basic notmuch-show view in emacs without indentation" maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) -test_emacs "(let ((notmuch-indent-messages-width 0)) +test_emacs "(let ((notmuch-show-indent-messages-width 0)) (notmuch-show \"$maildir_storage_thread\") (test-output))" test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-without-indentation test_begin_subtest "Basic notmuch-show view in emacs with fourfold indentation" maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu) -test_emacs "(let ((notmuch-indent-messages-width 4)) +test_emacs "(let ((notmuch-show-indent-messages-width 4)) (notmuch-show \"$maildir_storage_thread\") (test-output))" test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-maildir-storage-with-fourfold-indentation @@ -81,7 +81,7 @@ cat <EXPECTED "Invalid " From" (2001-01-05) (inbox) Subject: message-with-invalid-from To: Notmuch Test Suite -Date: Tue, 05 Jan 2001 15:43:57 -0000 +Date: Fri, 05 Jan 2001 15:43:57 +0000 This is just a test message (#1) EOF @@ -320,7 +320,7 @@ add_message '[from]="Top Poster "' \ ----- Original Message ----- From: Notmuch Test Suite To: Notmuch Test Suite -Sent: Tue, 05 Jan 2001 15:43:57 -0000 +Sent: Fri, 05 Jan 2001 15:43:57 +0000 Subject: The problem with top-posting Q: Why is top-posting such a bad thing? @@ -331,7 +331,7 @@ test_emacs "(notmuch-show \"top-posting\") echo "Notmuch Test Suite (2001-01-05) (inbox) Subject: The problem with top-posting To: Notmuch Test Suite -Date: Tue, 05 Jan 2001 15:43:57 -0000 +Date: Fri, 05 Jan 2001 15:43:57 +0000 A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? @@ -340,7 +340,7 @@ Q: What is the most annoying thing in e-mail? Top Poster (2001-01-05) (inbox unread) Subject: Re: The problem with top-posting To: Notmuch Test Suite -Date: Tue, 05 Jan 2001 15:43:57 -0000 +Date: Fri, 05 Jan 2001 15:43:57 +0000 Thanks for the advice! I will be sure to put it to good use. @@ -414,32 +414,6 @@ test_emacs '(notmuch-search "id:\"bought\"") sed -i -e 's/^thread:.*$/thread:XXX/' OUTPUT test_expect_equal "$(cat OUTPUT)" "thread:XXX" -test_begin_subtest 'Hiding message following HTML part' -test_subtest_known_broken -id='html-message@notmuchmail.org' -emacs_deliver_message \ - 'HTML message' \ - '' \ - "(message-goto-eoh) - (insert \"Message-ID: <$id>\n\") - (message-goto-body) - (mml-insert-part \"text/html\") - (insert \"This is a test HTML message\")" -emacs_deliver_message \ - 'Reply to HTML message' \ - 'This is a reply to the test HTML message' \ - "(message-goto-eoh) - (insert \"In-Reply-To: <$id>\n\")" -test_emacs "(notmuch-show \"id:$id\") \ - (notmuch-show-next-message) \ - (command-execute (key-binding (kbd \"RET\"))) \ - (test-visible-output)" -test_emacs "(notmuch-show \"id:$id\") \ - (notmuch-show-next-message) \ - (notmuch-show-toggle-message) \ - (test-visible-output \"EXPECTED\")" -test_expect_equal_file OUTPUT EXPECTED - test_begin_subtest 'notmuch-show-advance-and-archive with invisible signature' message1='id:20091118010116.GC25380@dottiness.seas.harvard.edu' message2='id:1258491078-29658-1-git-send-email-dottedmag@dottedmag.net' @@ -472,4 +446,72 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail. (test-visible-output)' test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "Do not call notmuch for non-inlinable application/mpeg parts" +id='message-with-application/mpeg-attachment@notmuchmail.org' +emacs_deliver_message \ + 'Message with application/mpeg attachment' \ + '' \ + "(message-goto-eoh) + (insert \"Message-ID: <$id>\n\") + (message-goto-body) + (mml-insert-part \"application/mpeg\") + (insert \"a fake mp3 file\")" +notmuch_counter_reset +test_emacs "(let ((notmuch-command \"$notmuch_counter_command\")) + (notmuch-show \"id:$id\"))" +test_expect_equal $(notmuch_counter_value) 1 + +test_begin_subtest "Do not call notmuch for non-inlinable audio/mpeg parts" +id='message-with-audio/mpeg-attachment@notmuchmail.org' +emacs_deliver_message \ + 'Message with audio/mpeg attachment' \ + '' \ + "(message-goto-eoh) + (insert \"Message-ID: <$id>\n\") + (message-goto-body) + (mml-insert-part \"audio/mpeg\") + (insert \"a fake mp3 file\")" +notmuch_counter_reset +test_emacs "(let ((notmuch-command \"$notmuch_counter_command\")) + (notmuch-show \"id:$id\"))" +test_expect_equal $(notmuch_counter_value) 1 + +test_begin_subtest "notmuch-hello-mode hook is called" +counter=$(test_emacs \ + '(let ((notmuch-hello-mode-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + notmuch-hello-mode-hook-counter)' +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-mode hook is not called on updates" +counter=$(test_emacs \ + '(let ((notmuch-hello-mode-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + (notmuch-hello-update) + notmuch-hello-mode-hook-counter)' +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-refresh hook is called" +counter=$(test_emacs \ + '(let ((notmuch-hello-refresh-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + notmuch-hello-refresh-hook-counter)' +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-refresh hook is called on updates" +counter=$(test_emacs \ + '(let ((notmuch-hello-refresh-hook-counter 0)) + (kill-buffer "*notmuch-hello*") + (notmuch-hello) + (notmuch-hello-update) + notmuch-hello-refresh-hook-counter)' +) +test_expect_equal "$counter" 2 + test_done