[PATCH 2/2] emacs: Tests for user-defined sections
authorDaniel Schoepe <daniel.schoepe@googlemail.com>
Sat, 2 Jul 2011 13:31:11 +0000 (15:31 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:55 +0000 (09:38 -0800)
b2/fa8cc05b88661795c18f26db54f15b160c5220 [new file with mode: 0644]

diff --git a/b2/fa8cc05b88661795c18f26db54f15b160c5220 b/b2/fa8cc05b88661795c18f26db54f15b160c5220
new file mode 100644 (file)
index 0000000..ce14cb0
--- /dev/null
@@ -0,0 +1,241 @@
+Return-Path: <daniel.schoepe@googlemail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id CABE0429E2E\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Jul 2011 06:31:45 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ykwU6UBe+DaY for <notmuch@notmuchmail.org>;\r
+       Sat,  2 Jul 2011 06:31:43 -0700 (PDT)\r
+Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com\r
+       [209.85.161.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 4FA70429E31\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Jul 2011 06:31:36 -0700 (PDT)\r
+Received: by mail-fx0-f46.google.com with SMTP id 19so4067538fxh.19\r
+       for <notmuch@notmuchmail.org>; Sat, 02 Jul 2011 06:31:36 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=googlemail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=2oZ5VMMOUsF0XLbqMw/5te/sVxIULU1bqX3ABVRJX9o=;\r
+       b=NRrkJmsV4YViSKGt/fj8MkiKHfawhLxy+tC2hX8iaL4c9SZtl4e0/cqqUXoKArzTEm\r
+       5ICLWiibZ6iuRl+nIpAdzVgLaobLjp6/BLgPZHTfDVP6yhy9mpZVp0C/COZGt2iP0Et7\r
+       qsjWeBZtEHQ4xHhXST43uxAncNM2EV33B7X6o=\r
+Received: by 10.223.81.80 with SMTP id w16mr6528368fak.65.1309613496012;\r
+       Sat, 02 Jul 2011 06:31:36 -0700 (PDT)\r
+Received: from localhost (p4FC79C4C.dip0.t-ipconnect.de [79.199.156.76])\r
+       by mx.google.com with ESMTPS id j23sm3083159fai.39.2011.07.02.06.31.34\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 02 Jul 2011 06:31:35 -0700 (PDT)\r
+From: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] emacs: Tests for user-defined sections\r
+Date: Sat,  2 Jul 2011 15:31:11 +0200\r
+Message-Id: <1309613471-23465-3-git-send-email-daniel.schoepe@googlemail.com>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1309613471-23465-1-git-send-email-daniel.schoepe@googlemail.com>\r
+References: <1309379221-5617-1-git-send-email-daniel.schoepe@googlemail.com>\r
+       <1309613471-23465-1-git-send-email-daniel.schoepe@googlemail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 02 Jul 2011 13:31:46 -0000\r
+\r
+---\r
+ test/emacs                                         |   37 ++++++++++++++++++++\r
+ test/emacs.expected-output/notmuch-hello           |    3 +-\r
+ .../notmuch-hello-new-section                      |    4 ++\r
+ .../notmuch-hello-no-saved-searches                |    3 +-\r
+ .../notmuch-hello-section-before                   |   18 +++++++++\r
+ .../notmuch-hello-section-counts                   |    5 +++\r
+ .../notmuch-hello-section-hidden-tag               |    4 ++\r
+ .../notmuch-hello-section-with-empty               |    4 ++\r
+ .../emacs.expected-output/notmuch-hello-with-empty |    3 +-\r
+ 9 files changed, 78 insertions(+), 3 deletions(-)\r
+ create mode 100644 test/emacs.expected-output/notmuch-hello-new-section\r
+ create mode 100644 test/emacs.expected-output/notmuch-hello-section-before\r
+ create mode 100644 test/emacs.expected-output/notmuch-hello-section-counts\r
+ create mode 100644 test/emacs.expected-output/notmuch-hello-section-hidden-tag\r
+ create mode 100644 test/emacs.expected-output/notmuch-hello-section-with-empty\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 53f455a..e5ae509 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -34,6 +34,43 @@ test_emacs '(let ((notmuch-saved-searches\r
+             (test-output))'\r
+ test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-no-saved-searches\r
\r
++test_begin_subtest "User defined section with inbox tag"\r
++test_emacs "(let ((notmuch-hello-sections \r
++                   (list (lambda () (notmuch-hello-insert-query-list\r
++                                     \"Test: \" '((\"inbox\" . \"tag:inbox\")))))))\r
++           (notmuch-hello)\r
++           (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-new-section\r
++\r
++test_begin_subtest "User defined section with empty, hidden entry"\r
++test_emacs "(let ((notmuch-hello-sections \r
++                   (list (lambda () (notmuch-hello-insert-query-list\r
++                                     \"Test-with-empty:\" \r
++                                     '((\"inbox\" . \"tag:inbox\")\r
++                                       (\"doesnotexist\" . \"tag:doesnotexist\"))\r
++                                     :hide-empty-tags t)))))\r
++             (notmuch-hello)\r
++             (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-with-empty\r
++\r
++test_begin_subtest "User defined section, unread tag filtered out"\r
++test_emacs "(let ((notmuch-hello-sections \r
++                   (list (lambda () (notmuch-hello-insert-tags-section\r
++                                     :title \"Test-with-filtered: \"\r
++                                     :hide-tags '(\"unread\"))))))\r
++             (notmuch-hello)\r
++             (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-hidden-tag\r
++\r
++test_begin_subtest "User defined section, different query for counts"\r
++test_emacs "(let ((notmuch-hello-sections\r
++                   (list (lambda () (notmuch-hello-insert-tags-section\r
++                                     :title \"Test-with-counts: \"\r
++                                     :make-count \"tag:signed\")))))\r
++             (notmuch-hello)\r
++             (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts\r
++\r
+ test_begin_subtest "Basic notmuch-search view in emacs"\r
+ test_emacs '(notmuch-search "tag:inbox")\r
+           (notmuch-test-wait)\r
+diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
+index 64b7e42..9666327 100644\r
+--- a/test/emacs.expected-output/notmuch-hello\r
++++ b/test/emacs.expected-output/notmuch-hello\r
+@@ -6,9 +6,10 @@ Saved searches: [edit]\r
\r
+ Search:                                                                     \r
\r
+-[Show all tags]\r
++All tags: [show]\r
\r
+        Type a search query and hit RET to view matching threads.\r
+               Edit saved searches with the `edit' button.\r
+   Hit RET or click on a saved search or tag name to view matching threads.\r
+     `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
++\r
+diff --git a/test/emacs.expected-output/notmuch-hello-new-section b/test/emacs.expected-output/notmuch-hello-new-section\r
+new file mode 100644\r
+index 0000000..be7b26a\r
+--- /dev/null\r
++++ b/test/emacs.expected-output/notmuch-hello-new-section\r
+@@ -0,0 +1,4 @@\r
++Test: [hide]\r
++\r
++        50 inbox  \r
++\r
+diff --git a/test/emacs.expected-output/notmuch-hello-no-saved-searches b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
+index 7f8206a..744a8f1 100644\r
+--- a/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
++++ b/test/emacs.expected-output/notmuch-hello-no-saved-searches\r
+@@ -2,9 +2,10 @@\r
\r
+ Search:                                                                     \r
\r
+-[Show all tags]\r
++All tags: [show]\r
\r
+        Type a search query and hit RET to view matching threads.\r
+               Edit saved searches with the `edit' button.\r
+   Hit RET or click on a saved search or tag name to view matching threads.\r
+     `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
++\r
+diff --git a/test/emacs.expected-output/notmuch-hello-section-before b/test/emacs.expected-output/notmuch-hello-section-before\r
+new file mode 100644\r
+index 0000000..a5781ce\r
+--- /dev/null\r
++++ b/test/emacs.expected-output/notmuch-hello-section-before\r
+@@ -0,0 +1,18 @@\r
++   Welcome to notmuch. You have 50 messages.\r
++\r
++Saved searches: [edit]\r
++\r
++        50 inbox                 50 unread          \r
++\r
++Test-before [hide]\r
++\r
++         4 attachment             7 signed          \r
++        50 inbox                 50 unread          \r
++\r
++Search:                                                                     \r
++\r
++\r
++       Type a search query and hit RET to view matching threads.\r
++              Edit saved searches with the `edit' button.\r
++  Hit RET or click on a saved search or tag name to view matching threads.\r
++    `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
+diff --git a/test/emacs.expected-output/notmuch-hello-section-counts b/test/emacs.expected-output/notmuch-hello-section-counts\r
+new file mode 100644\r
+index 0000000..12d19ed\r
+--- /dev/null\r
++++ b/test/emacs.expected-output/notmuch-hello-section-counts\r
+@@ -0,0 +1,5 @@\r
++Test-with-counts: [hide]\r
++\r
++         2 attachment             7 inbox                  7 signed          \r
++         7 unread          \r
++\r
+diff --git a/test/emacs.expected-output/notmuch-hello-section-hidden-tag b/test/emacs.expected-output/notmuch-hello-section-hidden-tag\r
+new file mode 100644\r
+index 0000000..eb21c07\r
+--- /dev/null\r
++++ b/test/emacs.expected-output/notmuch-hello-section-hidden-tag\r
+@@ -0,0 +1,4 @@\r
++Test-with-filtered: [hide]\r
++\r
++         4 attachment            50 inbox                  7 signed          \r
++\r
+diff --git a/test/emacs.expected-output/notmuch-hello-section-with-empty b/test/emacs.expected-output/notmuch-hello-section-with-empty\r
+new file mode 100644\r
+index 0000000..c5b6623\r
+--- /dev/null\r
++++ b/test/emacs.expected-output/notmuch-hello-section-with-empty\r
+@@ -0,0 +1,4 @@\r
++Test-with-empty:[hide]\r
++\r
++        50 inbox  \r
++\r
+diff --git a/test/emacs.expected-output/notmuch-hello-with-empty b/test/emacs.expected-output/notmuch-hello-with-empty\r
+index a9ed630..e9c8eb9 100644\r
+--- a/test/emacs.expected-output/notmuch-hello-with-empty\r
++++ b/test/emacs.expected-output/notmuch-hello-with-empty\r
+@@ -6,9 +6,10 @@ Saved searches: [edit]\r
\r
+ Search:                                                                     \r
\r
+-[Show all tags]\r
++All tags: [show]\r
\r
+        Type a search query and hit RET to view matching threads.\r
+               Edit saved searches with the `edit' button.\r
+   Hit RET or click on a saved search or tag name to view matching threads.\r
+     `=' refreshes this screen. `s' jumps to the search box. `q' to quit.\r
++\r
+-- \r
+1.7.5.4\r
+\r