X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT460-emacs-tree.sh;h=cb2c90b80991ec4a1bf31529bc1f6e74493eefdd;hp=946583d9f397f6602363804735fb2fa0779f0799;hb=HEAD;hpb=7556bb7da27621895327b84d22abba2519c24ba7 diff --git a/test/T460-emacs-tree.sh b/test/T460-emacs-tree.sh index 946583d9..6ef5c54a 100755 --- a/test/T460-emacs-tree.sh +++ b/test/T460-emacs-tree.sh @@ -100,7 +100,7 @@ test_emacs '(notmuch-hello) (notmuch-test-wait) (test-output) (delete-other-windows)' -test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox-oldest-first OUTPUT test_begin_subtest "Tree view of a single thread (from search)" test_emacs '(notmuch-hello) @@ -194,4 +194,56 @@ test_emacs ' ' 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" + +# reinitialize database for outline tests +add_email_corpus + +test_begin_subtest "start in outline mode" +test_emacs '(let ((notmuch-tree-outline-enabled t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (test-visible-output))' +# folding all messages by height or depth should look the same +test_expect_equal_file $EXPECTED/inbox-outline OUTPUT + +test_begin_subtest "outline-cycle-buffer" +test_emacs '(let ((notmuch-tree-outline-enabled t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (outline-cycle-buffer) + (outline-cycle-buffer) + (notmuch-test-wait) + (test-visible-output))' +# folding all messages by height or depth should look the same +test_expect_equal_file $EXPECTED/notmuch-tree-tag-inbox OUTPUT + +test_done + +add_email_corpus duplicate + +ID3=87r2ecrr6x.fsf@zephyr.silentflame.com +test_begin_subtest "duplicate=3, subject" +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_begin_subtest "duplicate=4" +test_emacs "(notmuch-show \"id:${ID3}\") + (notmuch-test-wait) + (notmuch-tree-show-message t) + (notmuch-show-choose-duplicate 4) + (test-visible-output \"OUTPUT\")" +test_expect_equal_file_nonempty $NOTMUCH_SRCDIR/test/emacs-show.expected-output/notmuch-show-duplicate-4 OUTPUT + test_done