[PATCH 2/2] test: add test for `notmuch-hello-refresh-hook'
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 21 Dec 2011 18:18:26 +0000 (22:18 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:09 +0000 (09:41 -0800)
0e/0627a4bca9f282aa9bca7512e2ee61ec1c970c [new file with mode: 0644]

diff --git a/0e/0627a4bca9f282aa9bca7512e2ee61ec1c970c b/0e/0627a4bca9f282aa9bca7512e2ee61ec1c970c
new file mode 100644 (file)
index 0000000..e16cb6e
--- /dev/null
@@ -0,0 +1,108 @@
+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 B70C4429E2E\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 10:19:13 -0800 (PST)\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 QaNb0pubgQEJ for <notmuch@notmuchmail.org>;\r
+       Wed, 21 Dec 2011 10:19:13 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ D3E5B431FD0   for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 10:19:12 -0800\r
+ (PST)\r
+Received: by mail-ww0-f45.google.com with SMTP id ds13so11998557wgb.2\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 10:19:12 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=nFfJ1ZGMCBkByzPRDuYANmlKoPCkhn4CdmlBD3qhQQs=;\r
+       b=mU+1Zqpz+Y29AXX5+r8Z+q2AWB+xh67KVKz/4LQ1kik1iAjf9UFhXy/gD9wTfW9SVp\r
+       ffkqSdv51oiiHAtJKzXaMnYaNRw1K31LpbBO6naQaHtKw3bxv432hmKOal27EX52czAb\r
+       NPPVHJ4e/2sKKhgjwE8LNCEBBtAmDwABKEB68=\r
+Received: by 10.227.208.134 with SMTP id gc6mr7315998wbb.3.1324491552438;\r
+       Wed, 21 Dec 2011 10:19:12 -0800 (PST)\r
+Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id\r
+       en20sm15465622wid.10.2011.12.21.10.19.11\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 21 Dec 2011 10:19:12 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] test: add test for `notmuch-hello-refresh-hook'\r
+Date: Wed, 21 Dec 2011 22:18:26 +0400\r
+Message-Id: <1324491506-1134-2-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.7.3\r
+In-Reply-To: <1324491506-1134-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1324491506-1134-1-git-send-email-dmitry.kurochkin@gmail.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: Wed, 21 Dec 2011 18:19:14 -0000\r
+\r
+Test that `notmuch-hello-refresh-hook' is called once when\r
+`notmuch-hello' is called and twice when calling\r
+`notmuch-hello-update' after that.\r
+\r
+The tests are very similar to tests for `notmuch-hello-mode-hook'.\r
+---\r
+ test/emacs       |   19 +++++++++++++++++++\r
+ test/test-lib.el |    1 +\r
+ 2 files changed, 20 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index dffad0f..ca82445 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -495,4 +495,23 @@ counter=$(test_emacs \\r
+ )\r
+ test_expect_equal "$counter" 1\r
\r
++test_begin_subtest "notmuch-hello-refresh hook is called"\r
++counter=$(test_emacs \\r
++    '(let ((notmuch-hello-refresh-hook-counter 0))\r
++       (kill-buffer "*notmuch-hello*")\r
++       (notmuch-hello)\r
++       notmuch-hello-refresh-hook-counter)'\r
++)\r
++test_expect_equal "$counter" 1\r
++\r
++test_begin_subtest "notmuch-hello-refresh hook is called on updates"\r
++counter=$(test_emacs \\r
++    '(let ((notmuch-hello-refresh-hook-counter 0))\r
++       (kill-buffer "*notmuch-hello*")\r
++       (notmuch-hello)\r
++       (notmuch-hello-update)\r
++       notmuch-hello-refresh-hook-counter)'\r
++)\r
++test_expect_equal "$counter" 2\r
++\r
+ test_done\r
+diff --git a/test/test-lib.el b/test/test-lib.el\r
+index 83b8a65..3b817c3 100644\r
+--- a/test/test-lib.el\r
++++ b/test/test-lib.el\r
+@@ -75,3 +75,4 @@ nothing."\r
+   (add-hook hook (apply-partially 'hook-counter hook)))\r
\r
+ (add-hook-counter 'notmuch-hello-mode-hook)\r
++(add-hook-counter 'notmuch-hello-refresh-hook)\r
+-- \r
+1.7.7.3\r
+\r