mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
test: add test for `notmuch-hello-refresh-hook'
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'.
This commit is contained in:
parent
eb8638ba2e
commit
9a0b61da56
2 changed files with 20 additions and 0 deletions
19
test/emacs
19
test/emacs
|
@ -495,4 +495,23 @@ counter=$(test_emacs \
|
||||||
)
|
)
|
||||||
test_expect_equal "$counter" 1
|
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
|
test_done
|
||||||
|
|
|
@ -75,3 +75,4 @@ nothing."
|
||||||
(add-hook hook (apply-partially 'hook-counter hook)))
|
(add-hook hook (apply-partially 'hook-counter hook)))
|
||||||
|
|
||||||
(add-hook-counter 'notmuch-hello-mode-hook)
|
(add-hook-counter 'notmuch-hello-mode-hook)
|
||||||
|
(add-hook-counter 'notmuch-hello-refresh-hook)
|
||||||
|
|
Loading…
Reference in a new issue