X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2Femacs;h=5bc3efcc6a87dc65b19031d489a804cc52b5fa2e;hb=e3c2be3e255f2845f6c6b45da96064e2bba681da;hp=f033bdf5d2d9fd2822946058bd38355421eab734;hpb=401dbebd4803477563eff03d719605ed37a8e44d;p=notmuch diff --git a/test/emacs b/test/emacs index f033bdf5..5bc3efcc 100755 --- a/test/emacs +++ b/test/emacs @@ -525,7 +525,9 @@ test_expect_equal_file attachment1.gz "$EXPECTED/attachment" test_begin_subtest "Save attachment from within emacs using notmuch-show-save-part" # save as archive to test that Emacs does not re-compress .gz test_emacs '(let ((standard-input "\"attachment2.gz\"")) - (notmuch-show-save-part "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com" 5))' + (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") + (search-forward "0001-Deal-with") + (notmuch-show-save-part))' test_expect_equal_file attachment2.gz "$EXPECTED/attachment" test_begin_subtest "Save 8bit attachment from within emacs using notmuch-show-save-attachments" @@ -853,11 +855,10 @@ test_expect_success "Rendering HTML mail with images" \ 'cat OUTPUT && grep -q smiley OUTPUT' -test_begin_subtest "Search handles subprocess errors" +test_begin_subtest "Search handles subprocess error exit codes" cat > notmuch_fail <&2 +echo '()' exit 1 EOF chmod a+x notmuch_fail @@ -872,17 +873,42 @@ test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) (test-output))" sed -i -e 's/^\[.*\]$/[XXX]/' ERROR test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\ -Error: Unexpected output from notmuch search: -This is output -Error: Unexpected output from notmuch search: -This is an error End of search results. --- $PWD/notmuch_fail exited with status 1 (see *Notmuch errors* for more details) --- [XXX] $PWD/notmuch_fail exited with status 1 -command: $PWD/notmuch_fail search --format\=json --format-version\=1 --sort\=newest-first tag\:inbox +command: $PWD/notmuch_fail search --format\=sexp --format-version\=1 --sort\=newest-first tag\:inbox exit status: 1" +test_begin_subtest "Search handles subprocess warnings" +cat > notmuch_fail <&2 +echo This is another warning >&2 +exit 0 +EOF +chmod a+x notmuch_fail +test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) + (with-current-buffer \"*Messages*\" (erase-buffer)) + (with-current-buffer \"*Notmuch errors*\" (erase-buffer)) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait) + (with-current-buffer \"*Messages*\" + (test-output \"MESSAGES\")) + (with-current-buffer \"*Notmuch errors*\" + (test-output \"ERROR\")) + (test-output))" +sed -i -e 's/^\[.*\]$/[XXX]/' ERROR +test_expect_equal "$(cat OUTPUT; echo ---; cat MESSAGES; echo ---; cat ERROR)" "\ +End of search results. +--- +This is a warning (see *Notmuch errors* for more details) +--- +[XXX] +This is a warning +This is another warning" + test_done