X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT440-emacs-hello.sh;h=dc80cc75880d59845a02e7c5b29c7b4965d7c0ce;hb=68640fd9670d12ea80d313fe30bfe42619e73f47;hp=a8ed22824e0c3efce61a86b42a886b59f09ad1ca;hpb=02a2eeb427d6b424029f6e5e5ddad4c6ec987741;p=notmuch diff --git a/test/T440-emacs-hello.sh b/test/T440-emacs-hello.sh index a8ed2282..dc80cc75 100755 --- a/test/T440-emacs-hello.sh +++ b/test/T440-emacs-hello.sh @@ -1,10 +1,12 @@ #!/usr/bin/env bash test_description="emacs notmuch-hello view" -. ./test-lib.sh || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 -EXPECTED=$TEST_DIRECTORY/emacs.expected-output +EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output +test_require_emacs add_email_corpus test_begin_subtest "User-defined section with inbox tag" @@ -13,7 +15,7 @@ test_emacs "(let ((notmuch-hello-sections \"Test\" '((\"inbox\" . \"tag:inbox\"))))))) (notmuch-hello) (test-output))" -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-new-section +test_expect_equal_file $EXPECTED/notmuch-hello-new-section OUTPUT test_begin_subtest "User-defined section with empty, hidden entry" test_emacs "(let ((notmuch-hello-sections @@ -24,7 +26,7 @@ test_emacs "(let ((notmuch-hello-sections :hide-empty-searches t))))) (notmuch-hello) (test-output))" -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-with-empty +test_expect_equal_file $EXPECTED/notmuch-hello-section-with-empty OUTPUT test_begin_subtest "User-defined section, unread tag filtered out" test_emacs "(let ((notmuch-hello-sections @@ -33,7 +35,7 @@ test_emacs "(let ((notmuch-hello-sections :hide-tags '(\"unread\")))))) (notmuch-hello) (test-output))" -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-hidden-tag +test_expect_equal_file $EXPECTED/notmuch-hello-section-hidden-tag OUTPUT test_begin_subtest "User-defined section, different query for counts" test_emacs "(let ((notmuch-hello-sections @@ -42,21 +44,21 @@ test_emacs "(let ((notmuch-hello-sections :filter-count \"tag:signed\"))))) (notmuch-hello) (test-output))" -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts +test_expect_equal_file $EXPECTED/notmuch-hello-section-counts OUTPUT test_begin_subtest "Empty custom tags section" test_emacs "(let* ((widget (widget-create 'notmuch-hello-tags-section)) (notmuch-hello-sections (list (widget-value widget)))) (notmuch-hello) (test-output))" -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-empty-custom-tags-section +test_expect_equal_file $EXPECTED/notmuch-hello-empty-custom-tags-section OUTPUT test_begin_subtest "Empty custom queries section" test_emacs "(let* ((widget (widget-create 'notmuch-hello-query-section)) (notmuch-hello-sections (list (widget-value widget)))) (notmuch-hello) (test-output))" -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-empty-custom-queries-section +test_expect_equal_file $EXPECTED/notmuch-hello-empty-custom-queries-section OUTPUT test_begin_subtest "Column alignment for tag/queries with long names" tag=a-very-long-tag # length carefully calculated for 80 characters window width @@ -64,6 +66,25 @@ notmuch tag +$tag '*' test_emacs '(notmuch-hello) (test-output)' notmuch tag -$tag '*' -test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-long-names +test_expect_equal_file $EXPECTED/notmuch-hello-long-names OUTPUT + +test_begin_subtest "All tags show up" +test_subtest_known_broken +tag=exclude_me +notmuch tag +$tag '*' +notmuch config set search.exclude_tags $tag +test_emacs '(notmuch-hello) + (test-output)' +notmuch tag -$tag '*' +test_expect_equal_file $EXPECTED/notmuch-hello-all-tags OUTPUT + +test_done +test_begin_subtest "notmuch-hello with nonexistent CWD" +test_emacs ' + (notmuch-hello) + (test-log-error + (let ((default-directory "/nonexistent")) + (notmuch-hello-update)))' +test_expect_equal "$(cat MESSAGES)" "COMPLETE" test_done