[PATCH v10 2/2] emacs: Tests for user-defined sections
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Fri, 17 Feb 2012 14:48:08 +0000 (18:48 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:37 +0000 (09:44 -0800)
9e/283adef6a29e185421610058a9e060db6798e0 [new file with mode: 0644]

diff --git a/9e/283adef6a29e185421610058a9e060db6798e0 b/9e/283adef6a29e185421610058a9e060db6798e0
new file mode 100644 (file)
index 0000000..dfae72e
--- /dev/null
@@ -0,0 +1,238 @@
+Return-Path: <dmitry.kurochkin@gmail.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 5EE2B429E45\r
+       for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 06:52:26 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.061\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.061 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_BL_SPAMCOP_NET=1.246,\r
+       RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=0.614] 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 oWJDFG1lVdbU for <notmuch@notmuchmail.org>;\r
+       Fri, 17 Feb 2012 06:52:24 -0800 (PST)\r
+Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
+ [74.125.83.53])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 3FDD6429E42   for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 06:52:24 -0800\r
+ (PST)\r
+Received: by eeke51 with SMTP id e51so1866152eek.26\r
+       for <notmuch@notmuchmail.org>; Fri, 17 Feb 2012 06:52:23 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=LxQlRBDe/lO9TI1FmdmvnCqydzCuWjNqrSIjM6OCMZM=;\r
+       b=rFv5cE7R7uOZTy9w7aaaXXCc76F8KUAvC1RtqeZSLrf1IkbM7chAOEK4tHWzJuVesY\r
+       5RSE1sIq1pSiec1h+gVkQxmilEm1rmC0pPSwa4rluSiSbZmSkpZJfe5Xef+3ybV34foo\r
+       onkY9OQVli/b5SILxD5VBWf+u9JoTYJTmiyw4=\r
+Received: by 10.213.105.140 with SMTP id t12mr1157134ebo.71.1329490343032;\r
+       Fri, 17 Feb 2012 06:52:23 -0800 (PST)\r
+Received: from localhost ([83.149.45.5])\r
+       by mx.google.com with ESMTPS id v51sm39300413eef.2.2012.02.17.06.51.21\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 17 Feb 2012 06:52:22 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v10 2/2] emacs: Tests for user-defined sections\r
+Date: Fri, 17 Feb 2012 18:48:08 +0400\r
+Message-Id: <1329490088-8323-3-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.9\r
+In-Reply-To: <1329490088-8323-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1310079227-19120-1-git-send-email-daniel.schoepe@googlemail.com>\r
+       <1329490088-8323-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+Cc: Daniel Schoepe <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: Fri, 17 Feb 2012 14:52:26 -0000\r
+\r
+From: Daniel Schoepe <daniel.schoepe@googlemail.com>\r
+\r
+A new file was added for notmuch-hello tests.\r
+---\r
+ test/emacs-hello                                   |   47 ++++++++++++++++++++\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-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
+ test/notmuch-test                                  |    1 +\r
+ 9 files changed, 71 insertions(+), 3 deletions(-)\r
+ create mode 100755 test/emacs-hello\r
+ create mode 100644 test/emacs.expected-output/notmuch-hello-new-section\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-hello b/test/emacs-hello\r
+new file mode 100755\r
+index 0000000..b235e3a\r
+--- /dev/null\r
++++ b/test/emacs-hello\r
+@@ -0,0 +1,47 @@\r
++#!/usr/bin/env bash\r
++\r
++test_description="Testing emacs notmuch-hello view"\r
++. test-lib.sh\r
++\r
++EXPECTED=$TEST_DIRECTORY/emacs.expected-output\r
++\r
++add_email_corpus\r
++\r
++test_begin_subtest "User-defined section with inbox tag"\r
++test_emacs "(let ((notmuch-hello-sections\r
++                   (list (lambda () (notmuch-hello-insert-searches\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-searches\r
++                                     \"Test-with-empty\"\r
++                                     '((\"inbox\" . \"tag:inbox\")\r
++                                       (\"doesnotexist\" . \"tag:doesnotexist\"))\r
++                                     :hide-empty-searches 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
++                                     \"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
++                                     \"Test-with-counts\"\r
++                                     :filter-count \"tag:signed\")))))\r
++             (notmuch-hello)\r
++             (test-output))"\r
++test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts\r
++\r
++test_done\r
+diff --git a/test/emacs.expected-output/notmuch-hello b/test/emacs.expected-output/notmuch-hello\r
+index 3e59595..1470790 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
+       `=' to refresh this screen. `s' to search messages. `q' to quit.\r
++                          Customize this page.\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..c64d712\r
+--- /dev/null\r
++++ b/test/emacs.expected-output/notmuch-hello-new-section\r
+@@ -0,0 +1,4 @@\r
++Test: [hide]\r
++\r
++        52 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 ef0e5d0..05475b1 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
+       `=' to refresh this screen. `s' to search messages. `q' to quit.\r
++                          Customize this page.\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..9d79659\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 signed          \r
++         7 inbox                  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..3688e7c\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            52 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..8209fed\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
++        52 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 71edba7..5e53222 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
+       `=' to refresh this screen. `s' to search messages. `q' to quit.\r
++                          Customize this page.\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index e14d34e..f03b594 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -54,6 +54,7 @@ TESTS="\r
+   argument-parsing\r
+   emacs-test-functions\r
+   emacs-address-cleaning\r
++  emacs-hello\r
+   emacs-show\r
+ "\r
+ TESTS=${NOTMUCH_TESTS:=$TESTS}\r
+-- \r
+1.7.9\r
+\r