unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: Thomas Jost <schnouki@schnouki.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH 2/2] test: add test for `notmuch-hello-refresh-hook'
Date: Thu, 22 Dec 2011 01:54:21 +0400	[thread overview]
Message-ID: <87d3bh7fqq.fsf@gmail.com> (raw)
In-Reply-To: <87ipl9k33a.fsf@schnouki.net>

On Wed, 21 Dec 2011 22:49:13 +0100, Thomas Jost <schnouki@schnouki.net> wrote:
> On Wed, 21 Dec 2011 22:18:26 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> 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

  reply	other threads:[~2011-12-21 21:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21 18:18 [PATCH 1/2] test: add general Emacs hook counter Dmitry Kurochkin
2011-12-21 18:18 ` [PATCH 2/2] test: add test for `notmuch-hello-refresh-hook' Dmitry Kurochkin
2011-12-21 21:49   ` Thomas Jost
2011-12-21 21:54     ` Dmitry Kurochkin [this message]
2011-12-21 22:09       ` Thomas Jost
2011-12-22  8:55   ` Tomi Ollila
2011-12-22 11:29 ` [PATCH 1/2] test: add general Emacs hook counter David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d3bh7fqq.fsf@gmail.com \
    --to=dmitry.kurochkin@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=schnouki@schnouki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).