]> git.notmuchmail.org Git - notmuch/blobdiff - test/emacs
emacs: Support passing input via `notmuch-call-notmuch-*'
[notmuch] / test / emacs
index e3cf4690cee4a82b5eca1c0608d091bf9c5a9e04..05295af8afc3f2e90887cb1a4ce85581f0a0a382 100755 (executable)
@@ -858,12 +858,14 @@ test_expect_success "Rendering HTML mail with images" \
 test_begin_subtest "Search handles subprocess error exit codes"
 cat > notmuch_fail <<EOF
 #!/bin/sh
-echo This is output
+echo '()'
 exit 1
 EOF
 chmod a+x notmuch_fail
 test_emacs "(let ((notmuch-command \"$PWD/notmuch_fail\"))
               (with-current-buffer \"*Messages*\" (erase-buffer))
+              (with-current-buffer (get-buffer-create \"*Notmuch errors*\")
+                 (erase-buffer))
               (notmuch-search \"tag:inbox\")
               (notmuch-test-wait)
               (with-current-buffer \"*Messages*\"
@@ -873,21 +875,19 @@ 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
 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 <<EOF
 #!/bin/sh
-echo This is output
+echo '()'
 echo This is a warning >&2
 echo This is another warning >&2
 exit 0
@@ -895,7 +895,8 @@ 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))
+              (with-current-buffer (get-buffer-create \"*Notmuch errors*\")
+                 (erase-buffer))
               (notmuch-search \"tag:inbox\")
               (notmuch-test-wait)
               (with-current-buffer \"*Messages*\"
@@ -905,8 +906,6 @@ 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
 End of search results.
 ---
 This is a warning (see *Notmuch errors* for more details)