X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT460-emacs-tree.sh;h=bae26e3bb49cb7e4e189e10d01e51f7ac3fab958;hb=b3d466bf397a6f8d70bb50d6fa22c58e3d44badf;hp=0f4e4503fd6e472eff47565fe7a0a7252d2c9d27;hpb=7ac96b149f5a0e5c03b64856d7c20789dab3c628;p=notmuch diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh index 0f4e4503..bae26e3b 100755 --- a/test/T460-emacs-tree.sh +++ b/test/T460-emacs-tree.sh @@ -2,9 +2,11 @@ test_description="emacs tree view interface" . $(dirname "$0")/test-lib.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 -EXPECTED=$NOTMUCH_SRCDIR/test/tree.expected-output +EXPECTED=$NOTMUCH_SRCDIR/test/emacs-tree.expected-output +test_require_emacs add_email_corpus test_begin_subtest "Basic notmuch-tree view in emacs" @@ -177,4 +179,39 @@ output=$(test_emacs '(notmuch-tree "tag:inbox") (notmuch-show-stash-message-id)') test_expect_equal "$output" "\"Stashed: id:1258493565-13508-1-git-send-email-keithp@keithp.com\"" +test_begin_subtest "Functions in tree-result-format" +test_emacs ' +(let + ((notmuch-tree-result-format + (quote (("date" . "%12s ") + ("authors" . "%-20s") + ((("tree" . "%s") + ("subject" . "%s")) . " %-54s ") + (notmuch-test-result-flags . "(%s)"))))) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (test-output)) +' +test_expect_equal_file $EXPECTED/result-format-function OUTPUT + +test_begin_subtest "notmuch-tree with nonexistent CWD" +test_emacs '(test-log-error + (let ((default-directory "/nonexistent")) + (notmuch-tree "*")))' +test_expect_equal "$(cat MESSAGES)" "COMPLETE" + +add_email_corpus duplicate + +ID3=87r2ecrr6x.fsf@zephyr.silentflame.com +test_begin_subtest "duplicate=3" +test_emacs "(notmuch-tree \"id:${ID3}\") + (notmuch-test-wait) + (notmuch-tree-show-message t) + (notmuch-show-choose-duplicate 3) + (test-visible-output \"OUTPUT\")" +output=$(grep "Subject:" OUTPUT) +file=$(notmuch search --output=files id:${ID3} | head -n 3 | tail -n 1) +subject=$(grep '^Subject:' $file) +test_expect_equal "$output" "$subject" + test_done