diff options
author | Austin Clements <amdragon@MIT.EDU> | 2012-12-15 15:04:20 -0500 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-12-16 17:17:58 -0400 |
commit | 1e12b91b3cf823d21f7edf8c0f1c687df56fec14 (patch) | |
tree | 4489c79aa055d495baaf7ec0b3e1b8412f8e8810 /test | |
parent | 19e5b2d912b52145403c3f11b0c30c84d7f2b409 (diff) |
test: Test search's handling of subprocess errors
Diffstat (limited to 'test')
-rwxr-xr-x | test/emacs | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -853,4 +853,27 @@ test_expect_success "Rendering HTML mail with images" \ 'cat OUTPUT && grep -q smiley OUTPUT' +test_begin_subtest "Search handles subprocess errors" +cat > notmuch_fail <<EOF +#!/bin/sh +echo This is output +echo This is an error >&2 +exit 1 +EOF +chmod a+x notmuch_fail +test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\")) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait) + (test-output) + (with-current-buffer \"*Notmuch errors*\" + (test-output \"ERROR\")))" +test_expect_equal "$(cat OUTPUT ERROR)" "\ +Error: Unexpected output from notmuch search: +This is output +Error: Unexpected output from notmuch search: +This is an error +End of search results. +Error invoking notmuch. $PWD/notmuch_fail search --format=json --sort=newest-first tag:inbox exited with status 1." + + test_done |