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 7E090431FD0 for ; Wed, 21 Dec 2011 13:55:07 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 duJsdLOqoJSd for ; Wed, 21 Dec 2011 13:55:06 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A9703431FB6 for ; Wed, 21 Dec 2011 13:55:06 -0800 (PST) Received: by wgbds13 with SMTP id ds13so12229044wgb.2 for ; Wed, 21 Dec 2011 13:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=RFUTtbzEt2yx6ogxiUB9XxNCI4cHX0MDbkk/7W+O7PU=; b=YQYxZBJ1zbTHY2kgO5IPTc1gqMcmRPE4PjDBCrMLVIA64rxcFKrMgq8MEB79V8bykW 43LDT6FvpXULwp02onAiG4Wf0LLu5VWtX9e1j80CG8WG+k5og/piRfI05mmWyKrmL98w zlQifkPfHxfzMN9xaSYvV9g89JC0Gm2aLTl/c= Received: by 10.227.208.133 with SMTP id gc5mr7860916wbb.25.1324504505410; Wed, 21 Dec 2011 13:55:05 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id di5sm16841618wib.3.2011.12.21.13.55.04 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Dec 2011 13:55:04 -0800 (PST) From: Dmitry Kurochkin To: Thomas Jost , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] test: add test for `notmuch-hello-refresh-hook' In-Reply-To: <87ipl9k33a.fsf@schnouki.net> References: <1324491506-1134-1-git-send-email-dmitry.kurochkin@gmail.com> <1324491506-1134-2-git-send-email-dmitry.kurochkin@gmail.com> <87ipl9k33a.fsf@schnouki.net> User-Agent: Notmuch/0.10.2+116~ga89e197 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 22 Dec 2011 01:54:21 +0400 Message-ID: <87d3bh7fqq.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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:55:07 -0000 On Wed, 21 Dec 2011 22:49:13 +0100, Thomas Jost wrote: > 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. > > > > 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. > These patches do not touch notmuch-hello.el. The functions are added to test/test-lib.el. Regards, Dmitry > 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(-) > > > > diff --git a/test/emacs b/test/emacs > > index dffad0f..ca82445 100755 > > --- a/test/emacs > > +++ b/test/emacs > > @@ -495,4 +495,23 @@ counter=$(test_emacs \ > > ) > > test_expect_equal "$counter" 1 > > > > +test_begin_subtest "notmuch-hello-refresh hook is called" > > +counter=$(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=$(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))) > > > > (add-hook-counter 'notmuch-hello-mode-hook) > > +(add-hook-counter 'notmuch-hello-refresh-hook) > > -- > > 1.7.7.3 > > > > _______________________________________________ > > notmuch mailing list > > notmuch@notmuchmail.org > > http://notmuchmail.org/mailman/listinfo/notmuch > > -- > Thomas/Schnouki