Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0B610429E28 for ; Wed, 21 Dec 2011 05:13:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MET3aVTGiOmy for ; Wed, 21 Dec 2011 05:13:18 -0800 (PST) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id 6A38E431FB6 for ; Wed, 21 Dec 2011 05:13:18 -0800 (PST) Received: from odin.local (nancy.schnouki.net [78.238.0.45]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 4E7CC6A0026; Wed, 21 Dec 2011 14:13:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1324473197; bh=jLJiSeX4vE3ONwB4NLEOneQLUbdVXGKPyI4h970egIE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=j8EohwjR2p30BeCv5KoeAsT5kqflyg3T0X5QjehDv54l7ic+dHkvHA8iUkZd1kQhH P7SCagg7kzuJ7o2R9I+tJ6MHTyZ6UBHhcZiDMaSiJ6ubydhMNJEosdewTCxE0ijetK nl93anW/8YzEM6SfDOzZcIvKJchDbpXqjYwiHrlQ= From: Thomas Jost To: Dmitry Kurochkin Subject: [PATCH] test: add tests for `notmuch-hello-refresh-hook' Date: Wed, 21 Dec 2011 14:13:09 +0100 Message-Id: <1324473189-8622-1-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.8 In-Reply-To: <87iplawvx5.fsf@gmail.com> References: <87iplawvx5.fsf@gmail.com> Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2011 13:13:19 -0000 Test that it's called once when `notmuch-hello' is called, and twice when calling `notmuch-hello-update' after that. --- Here it is. No broken subtest first since the first patch was already pushed though. Regards, Thomas test/emacs | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/test/emacs b/test/emacs index dffad0f..94b9171 100755 --- a/test/emacs +++ b/test/emacs @@ -495,4 +495,27 @@ counter=$(test_emacs \ ) test_expect_equal "$counter" 1 +test_begin_subtest "notmuch-hello-refresh-hook is called" +counter=$(test_emacs \ + "(let ((refresh-hook-counter 0) + (notmuch-hello-refresh-hook nil)) + (kill-buffer \"*notmuch-hello*\") + (add-hook 'notmuch-hello-refresh-hook (lambda () (incf refresh-hook-counter))) + (notmuch-hello) + refresh-hook-counter)" +) +test_expect_equal "$counter" 1 + +test_begin_subtest "notmuch-hello-refresh-hook is called on updates" +counter=$(test_emacs \ + "(let ((refresh-hook-counter 0) + (notmuch-hello-refresh-hook nil)) + (kill-buffer \"*notmuch-hello*\") + (add-hook 'notmuch-hello-refresh-hook (lambda () (incf refresh-hook-counter))) + (notmuch-hello) + (notmuch-hello-update) + refresh-hook-counter)" +) +test_expect_equal "$counter" 2 + test_done -- 1.7.8