[PATCH 2/2] test: add test for `notmuch-hello-refresh-hook'
Dmitry Kurochkin
dmitry.kurochkin at gmail.com
Wed Dec 21 13:54:21 PST 2011
On Wed, 21 Dec 2011 22:49:13 +0100, Thomas Jost <schnouki at schnouki.net> wrote:
> On Wed, 21 Dec 2011 22:18:26 +0400, Dmitry Kurochkin <dmitry.kurochkin at 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 at 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 at notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
>
> --
> Thomas/Schnouki
More information about the notmuch
mailing list