unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Schoepe <daniel.schoepe@googlemail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v3 2/2] emacs: Tests for user-defined sections
Date: Tue,  5 Jul 2011 18:23:50 +0200	[thread overview]
Message-ID: <1309883030-28899-3-git-send-email-daniel.schoepe@googlemail.com> (raw)
In-Reply-To: <1309883030-28899-1-git-send-email-daniel.schoepe@googlemail.com>

---
 test/emacs                                         |   37 ++++++++++++++++++++
 test/emacs.expected-output/notmuch-hello           |    3 +-
 .../notmuch-hello-new-section                      |    4 ++
 .../notmuch-hello-no-saved-searches                |    3 +-
 .../notmuch-hello-section-before                   |   18 +++++++++
 .../notmuch-hello-section-counts                   |    5 +++
 .../notmuch-hello-section-hidden-tag               |    4 ++
 .../notmuch-hello-section-with-empty               |    4 ++
 .../emacs.expected-output/notmuch-hello-with-empty |    3 +-
 9 files changed, 78 insertions(+), 3 deletions(-)
 create mode 100644 test/emacs.expected-output/notmuch-hello-new-section
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-before
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-counts
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-hidden-tag
 create mode 100644 test/emacs.expected-output/notmuch-hello-section-with-empty

diff --git a/test/emacs b/test/emacs
index 53f455a..40e2563 100755
--- a/test/emacs
+++ b/test/emacs
@@ -34,6 +34,43 @@ test_emacs '(let ((notmuch-saved-searches
 	      (test-output))'
 test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches
 
+test_begin_subtest "User defined section with inbox tag"
+test_emacs "(let ((notmuch-hello-sections 
+                   (list (lambda () (notmuch-hello-insert-searches
+                                     \"Test: \" '((\"inbox\" . \"tag:inbox\")))))))
+           (notmuch-hello)
+           (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-new-section
+
+test_begin_subtest "User defined section with empty, hidden entry"
+test_emacs "(let ((notmuch-hello-sections 
+                   (list (lambda () (notmuch-hello-insert-searches
+                                     \"Test-with-empty:\" 
+                                     '((\"inbox\" . \"tag:inbox\")
+                                       (\"doesnotexist\" . \"tag:doesnotexist\"))
+                                     :hide-empty-searches t)))))
+             (notmuch-hello)
+             (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-with-empty
+
+test_begin_subtest "User defined section, unread tag filtered out"
+test_emacs "(let ((notmuch-hello-sections 
+                   (list (lambda () (notmuch-hello-insert-tags-section
+                                     \"Test-with-filtered: \"
+                                     :hide-tags '(\"unread\"))))))
+             (notmuch-hello)
+             (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-hidden-tag
+
+test_begin_subtest "User defined section, different query for counts"
+test_emacs "(let ((notmuch-hello-sections
+                   (list (lambda () (notmuch-hello-insert-tags-section
+                                     \"Test-with-counts: \"
+                                     :make-count \"tag:signed\")))))
+             (notmuch-hello)
+             (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts
+
 test_begin_subtest "Basic notmuch-search view in emacs"
 test_emacs '(notmuch-search "tag:inbox")
 	    (notmuch-test-wait)
diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello
index 64b7e42..9666327 100644
--- a/test/emacs.expected-output/notmuch-hello
+++ b/test/emacs.expected-output/notmuch-hello
@@ -6,9 +6,10 @@ Saved searches: [edit]
 
 Search:                                                                     
 
-[Show all tags]
+All tags: [show]
 
 	 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.
+
diff --git a/test/emacs.expected-output/notmuch-hello-new-section b/test/emacs.expected-output/notmuch-hello-new-section
new file mode 100644
index 0000000..be7b26a
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-new-section
@@ -0,0 +1,4 @@
+Test: [hide]
+
+	  50 inbox  
+
diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches
index 7f8206a..744a8f1 100644
--- a/test/emacs.expected-output/notmuch-hello-no-saved-searches
+++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches
@@ -2,9 +2,10 @@
 
 Search:                                                                     
 
-[Show all tags]
+All tags: [show]
 
 	 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.
+
diff --git a/test/emacs.expected-output/notmuch-hello-section-before b/test/emacs.expected-output/notmuch-hello-section-before
new file mode 100644
index 0000000..a5781ce
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-section-before
@@ -0,0 +1,18 @@
+   Welcome to notmuch. You have 50 messages.
+
+Saved searches: [edit]
+
+	  50 inbox                 50 unread          
+
+Test-before [hide]
+
+	   4 attachment             7 signed          
+	  50 inbox                 50 unread          
+
+Search:                                                                     
+
+
+	 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.
diff --git a/test/emacs.expected-output/notmuch-hello-section-counts b/test/emacs.expected-output/notmuch-hello-section-counts
new file mode 100644
index 0000000..12d19ed
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-section-counts
@@ -0,0 +1,5 @@
+Test-with-counts: [hide]
+
+	   2 attachment             7 inbox                  7 signed          
+	   7 unread          
+
diff --git a/test/emacs.expected-output/notmuch-hello-section-hidden-tag b/test/emacs.expected-output/notmuch-hello-section-hidden-tag
new file mode 100644
index 0000000..eb21c07
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-section-hidden-tag
@@ -0,0 +1,4 @@
+Test-with-filtered: [hide]
+
+	   4 attachment            50 inbox                  7 signed          
+
diff --git a/test/emacs.expected-output/notmuch-hello-section-with-empty b/test/emacs.expected-output/notmuch-hello-section-with-empty
new file mode 100644
index 0000000..c5b6623
--- /dev/null
+++ b/test/emacs.expected-output/notmuch-hello-section-with-empty
@@ -0,0 +1,4 @@
+Test-with-empty:[hide]
+
+	  50 inbox  
+
diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty
index a9ed630..e9c8eb9 100644
--- a/test/emacs.expected-output/notmuch-hello-with-empty
+++ b/test/emacs.expected-output/notmuch-hello-with-empty
@@ -6,9 +6,10 @@ Saved searches: [edit]
 
 Search:                                                                     
 
-[Show all tags]
+All tags: [show]
 
 	 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.
+
-- 
1.7.5.4

      parent reply	other threads:[~2011-07-05 16:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 20:26 [PATCH 0/2] emacs: User-defined sections in notmuch-hello Daniel Schoepe
2011-06-29 20:27 ` [PATCH 1/2] " Daniel Schoepe
2011-06-29 20:27 ` [PATCH 2/2] emacs: Tests for user-defined sections Daniel Schoepe
2011-07-02 13:31 ` [PATCH v2 0/2] emacs: User-defined sections in notmuch-hello Daniel Schoepe
2011-07-02 13:31   ` [PATCH 1/2] " Daniel Schoepe
2011-07-02 13:31   ` [PATCH 2/2] emacs: Tests for user-defined sections Daniel Schoepe
2011-07-05  0:00 ` [PATCH 0/2] emacs: User-defined sections in notmuch-hello Michal Sojka
2011-07-05  8:24   ` Daniel Schoepe
2011-07-05 14:09     ` Michal Sojka
2011-07-05 14:55       ` Daniel Schoepe
2011-07-05 16:43       ` Daniel Schoepe
2011-07-05 16:23 ` [PATCH v3 " Daniel Schoepe
2011-07-05 16:23   ` [PATCH v3 1/2] " Daniel Schoepe
2011-07-06 11:34     ` Michal Sojka
2011-07-06 12:41       ` Daniel Schoepe
2011-07-07 15:23         ` Michal Sojka
2011-07-07 18:25           ` Daniel Schoepe
2011-07-08 21:23             ` Michal Sojka
2011-07-08 22:03               ` Daniel Schoepe
2011-07-05 16:23   ` Daniel Schoepe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309883030-28899-3-git-send-email-daniel.schoepe@googlemail.com \
    --to=daniel.schoepe@googlemail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).