test: Test emacs notmuch-hello when displaying a saved search with 0 results.
authorCarl Worth <cworth@cworth.org>
Fri, 29 Oct 2010 22:49:59 +0000 (15:49 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 29 Oct 2010 22:50:42 +0000 (15:50 -0700)
This test verifies that the bug fix in the previous commit is working.

test/emacs
test/emacs.expected-output/notmuch-hello-with-empty [new file with mode: 0644]

index e6fa648ff270414d451e1b3ac756d4e79516ee89..f9da3184e6ed78b945b96124d6567c31a8d94efd 100755 (executable)
@@ -11,6 +11,11 @@ output=$(test_emacs '(notmuch-hello) (message (buffer-string))' 2>&1)
 expected=$(cat $EXPECTED/notmuch-hello)
 test_expect_equal "$output" "$expected"
 
+test_begin_subtest "Saved search with 0 results"
+output=$(test_emacs '(setq notmuch-show-empty-saved-searches t) (setq notmuch-saved-searches '\''(("inbox" . "tag:inbox") ("unread" . "tag:unread") ("empty" . "tag:doesnotexist"))) (notmuch-hello) (message (buffer-string))' 2>&1)
+expected=$(cat $EXPECTED/notmuch-hello-with-empty)
+test_expect_equal "$output" "$expected"
+
 test_begin_subtest "Basic notmuch-search view in emacs"
 output=$(test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) (message (buffer-string))' 2>&1)
 expected=$(cat $EXPECTED/notmuch-search-tag-inbox)
diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
new file mode 100644 (file)
index 0000000..a9ed630
--- /dev/null
@@ -0,0 +1,14 @@
+   Welcome to notmuch. You have 50 messages.
+
+Saved searches: [edit]
+
+         50 inbox           50 unread           0 empty     
+
+Search:                                                                     
+
+[Show all tags]
+
+        Type a search query and hit RET to view matching threads.
+               Edit saved searches with the `edit' button.
+  Hit RET or click on a saved search or tag name to view matching threads.
+    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.