aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLeo Okawa Ericson <git@relevant-information.com>2022-06-09 17:18:22 +0200
committerDavid Bremner <david@tethera.net>2022-06-13 08:06:51 -0300
commitfb4a0967cab7df737d5d53199a48a0e79c429b61 (patch)
treecbe1d47dc8b149cc359077f77df9706143291362 /test
parenta5504e8b1cfd8dddfe395ba4a46da3ea6008e714 (diff)
emacs: Make notmuch-show-next-thread return nil on failure
Having notmuch-show-next-thread return non-nil on success and nil on failure makes it easier for users to interact with notmuch via elisp. This commit changes notmuch-search-show-thread too since the return value of notmuch-show-next-thread depends on notmuch-search-show-thread. Amended by db: fix whitespace in T450-emacs-show
Diffstat (limited to 'test')
-rwxr-xr-xtest/T450-emacs-show.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh
index 678efd8b..0c1f6204 100755
--- a/test/T450-emacs-show.sh
+++ b/test/T450-emacs-show.sh
@@ -62,6 +62,17 @@ test_emacs '(let ((notmuch-crypto-process-mime nil))
(test-visible-output))'
test_expect_equal_file $EXPECTED/notmuch-show-process-crypto-mime-parts-on OUTPUT
+test_begin_subtest "notmuch-search-show-thread returns non-nil on success"
+test_emacs_expect_t '(notmuch-search "id:20091117203301.GV3165@dottiness.seas.harvard.edu")
+ (notmuch-test-wait)
+ (and (notmuch-search-show-thread)
+ (not (notmuch-show-next-thread)))'
+
+test_begin_subtest "notmuch-search-show-thread returns nil when there are no messages"
+test_emacs_expect_t '(notmuch-search "id:non-existing-id")
+ (notmuch-test-wait)
+ (not (notmuch-search-show-thread))'
+
test_begin_subtest "notmuch-show: don't elide non-matching messages"
test_emacs '(let ((notmuch-show-only-matching-messages nil))
(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir storage\"")