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 86F3B429E25 for ; Wed, 21 Dec 2011 13:49:21 -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 GFegej5LHBfT for ; Wed, 21 Dec 2011 13:49:20 -0800 (PST) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id 6A4B0431FB6 for ; Wed, 21 Dec 2011 13:49:20 -0800 (PST) Received: from odin.local (nancy.schnouki.net [78.238.0.45]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id 1830B6A0026; Wed, 21 Dec 2011 22:49:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1324504159; bh=9oHQXcLY15ZACejqDvyuVwuquj1oTuWUtLhNe6U/rdQ=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dNpxwkJUT+aeRU58vKwNFxxogoDCWQX+fYxfY6jSrlN+qUZ9eSkASkUMNZB0FTQcO RJBDjRc9JVvOVRnXr6QTB+Aqmws5PsndtnKSKfVjdoA8X4zOuNPHgeOExyfhfZb7ed iAUUED22pw7tr8EdErYJe97jLEI8MyzJTrNnaQ8w= From: Thomas Jost To: Dmitry Kurochkin , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] test: add test for `notmuch-hello-refresh-hook' In-Reply-To: <1324491506-1134-2-git-send-email-dmitry.kurochkin@gmail.com> References: <1324491506-1134-1-git-send-email-dmitry.kurochkin@gmail.com> <1324491506-1134-2-git-send-email-dmitry.kurochkin@gmail.com> User-Agent: Notmuch/0.10.2+131~gde16f21 (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-unknown-linux-gnu) Date: Wed, 21 Dec 2011 22:49:13 +0100 Message-ID: <87ipl9k33a.fsf@schnouki.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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 21:49:21 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 21 Dec 2011 22:18:26 +0400, Dmitry Kurochkin wrote: > Test that `notmuch-hello-refresh-hook' is called once when > `notmuch-hello' is called and twice when calling > `notmuch-hello-update' after that. >=20 > The tests are very similar to tests for `notmuch-hello-mode-hook'. Quite nice, better than what I sent earlier [1] :) However I'm not sure that notmuch-hello.el is the right place for this kind of stuff; notmuch-lib.el may be better (so that it can also be used in other hooks. Regards, Thomas [1] id:"1324473189-8622-1-git-send-email-schnouki@schnouki.net" > --- > test/emacs | 19 +++++++++++++++++++ > test/test-lib.el | 1 + > 2 files changed, 20 insertions(+), 0 deletions(-) >=20 > diff --git a/test/emacs b/test/emacs > index dffad0f..ca82445 100755 > --- a/test/emacs > +++ b/test/emacs > @@ -495,4 +495,23 @@ counter=3D$(test_emacs \ > ) > test_expect_equal "$counter" 1 >=20=20 > +test_begin_subtest "notmuch-hello-refresh hook is called" > +counter=3D$(test_emacs \ > + '(let ((notmuch-hello-refresh-hook-counter 0)) > + (kill-buffer "*notmuch-hello*") > + (notmuch-hello) > + notmuch-hello-refresh-hook-counter)' > +) > +test_expect_equal "$counter" 1 > + > +test_begin_subtest "notmuch-hello-refresh hook is called on updates" > +counter=3D$(test_emacs \ > + '(let ((notmuch-hello-refresh-hook-counter 0)) > + (kill-buffer "*notmuch-hello*") > + (notmuch-hello) > + (notmuch-hello-update) > + notmuch-hello-refresh-hook-counter)' > +) > +test_expect_equal "$counter" 2 > + > test_done > diff --git a/test/test-lib.el b/test/test-lib.el > index 83b8a65..3b817c3 100644 > --- a/test/test-lib.el > +++ b/test/test-lib.el > @@ -75,3 +75,4 @@ nothing." > (add-hook hook (apply-partially 'hook-counter hook))) >=20=20 > (add-hook-counter 'notmuch-hello-mode-hook) > +(add-hook-counter 'notmuch-hello-refresh-hook) > --=20 > 1.7.7.3 >=20 > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch =2D-=20 Thomas/Schnouki --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJO8lRZAAoJEMPdciX+bh5IhBIH/0940E8MabvAHXfDGp0zRDa0 TZAJYzGcnfFiwE0a3q7ryLHtavqVsqbCh4jQsdfDWY69gw0DPfiSV8tBK6lUT9fj D2pO5eAIcGBleZJmmen5eX2zXEn1gQFYzgT9oGWt0SYLTzNQ36YVwVYa3AZxsMYJ DNqV+q1OQttrJ2VXI5bnSuW8HE4k9xZRvvJqSq0FOY8A98ukk8M6tcpsQYLQJp+1 SbuvSy/h/anjNHqPj+iDc0iZ78Xyq6FlXzMea+2rC6dpWzuZfIhVdpx9yyFZHvsm tsBbzrh0XTonZQJ+LU2tTPc//wEZpFwtRMhszXgl/T6O8EMe99IWsIlVFHdBYUg= =US3y -----END PGP SIGNATURE----- --=-=-=--