diff options
author | Tom Willemse | 2020-04-07 21:30:12 -0700 |
---|---|---|
committer | Tom Willemse | 2020-04-07 21:30:12 -0700 |
commit | 6e177aa3d3259440498fab04cb1790e458dffdbe (patch) | |
tree | 6d22d0e4b1bc11365409796dc53e9a1fadcbbd54 /test | |
parent | f90d13d9c3a4b3711e72d8d6bf253693beb2719b (diff) | |
download | emacs-config-6e177aa3d3259440498fab04cb1790e458dffdbe.tar.gz emacs-config-6e177aa3d3259440498fab04cb1790e458dffdbe.zip |
Ensure idle timer for ‘recentf-save-list’ only gets created once
Diffstat (limited to 'test')
-rw-r--r-- | test/oni-core-test.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/oni-core-test.el b/test/oni-core-test.el index 0672fb3..eb9886e 100644 --- a/test/oni-core-test.el +++ b/test/oni-core-test.el @@ -59,3 +59,12 @@ (oni-core-move-end-of-dwim) (oni-core-move-end-of-dwim) (should (equal 21 (point))))) + +(ert-deftest oni-core-loading-is-idempotent-recentf-idle-timer () + "Test that loading ‘oni-core’ is idempotent in regards to an idle timer." + ;; We already loaded it with the ‘require’ call above. We load it again so we + ;; can check that the timer set up in it doesn’t appear twice. + (load-library "oni-core") + (let* ((pred (lambda (elt) (eq 'recentf-save-list (aref elt 5)))) + (matches (delete nil (mapcar pred timer-idle-list)))) + (should (eq 1 (length matches))))) |