X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Femacs;h=42bd0f18c1e4c8aac35a71aaebc920114df3662e;hb=64febdf71c4184ca369f5d11d7f196704a3ec1a6;hp=53f455a34b641dbd8e51610dffbb365e0602a631;hpb=ec1b568929f53b99362d6b254085da03231a2a26;p=notmuch diff --git a/test/emacs b/test/emacs index 53f455a3..42bd0f18 100755 --- a/test/emacs +++ b/test/emacs @@ -1,10 +1,5 @@ #!/usr/bin/env bash -# Note: do not use `setq' for setting variables in Emacs tests because -# it affects other tests that may run in the same Emacs instance. Use -# `let' instead so the scope of the changed variables is limited to a -# single test. - test_description="emacs interface" . test-lib.sh @@ -347,4 +342,103 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail. (test-visible-output)' test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages +test_begin_subtest "Stashing in notmuch-show" +add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \ + '[from]="Some One "' \ + '[to]="Some One Else "' \ + '[cc]="Notmuch "' \ + '[subject]="Stash my stashables"' \ + '[id]="bought"' \ + '[body]="Unable to stash body. Where did you get it in the first place?!?"' +notmuch tag +stashtest id:${gen_msg_id} +test_emacs '(notmuch-show "id:\"bought\"") + (notmuch-show-stash-date) + (notmuch-show-stash-from) + (notmuch-show-stash-to) + (notmuch-show-stash-cc) + (notmuch-show-stash-subject) + (notmuch-show-stash-message-id) + (notmuch-show-stash-message-id-stripped) + (notmuch-show-stash-tags) + (notmuch-show-stash-filename) + (switch-to-buffer + (generate-new-buffer "*test-stashing*")) + (dotimes (i 9) + (yank) + (insert "\n") + (rotate-yank-pointer 1)) + (reverse-region (point-min) (point-max)) + (test-output)' +sed -i -e 's/^.*tmp.emacs\/mail.*$/FILENAME/' OUTPUT +test_expect_equal_file OUTPUT $EXPECTED/emacs-stashing + +test_begin_subtest "Stashing in notmuch-search" +test_emacs '(notmuch-search "id:\"bought\"") + (notmuch-test-wait) + (notmuch-search-stash-thread-id) + (switch-to-buffer + (generate-new-buffer "*test-stashing*")) + (yank) + (test-output)' +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' +test_emacs "(notmuch-search \"$message1 or $message2\") + (notmuch-test-wait) + (notmuch-search-show-thread) + (goto-char (point-max)) + (redisplay) + (notmuch-show-advance-and-archive) + (test-output)" +test_emacs "(notmuch-show \"$message2\") + (test-output \"EXPECTED\")" +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "Refresh show buffer" +test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (test-visible-output "EXPECTED") + (notmuch-show-refresh-view) + (test-visible-output)' +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "Refresh modified show buffer" +test_subtest_known_broken +test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.gmail.com") + (notmuch-show-toggle-message) + (notmuch-show-next-message) + (notmuch-show-toggle-message) + (test-visible-output "EXPECTED") + (notmuch-show-refresh-view) + (test-visible-output)' +test_expect_equal_file OUTPUT EXPECTED + test_done