diff options
author | Paul Eggert <eggert@Penguin.CS.UCLA.EDU> | 2018-09-05 16:19:47 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-05 16:21:42 -0700 |
commit | 67475a59e95919e2dbe25ae950450578afdfd0dc (patch) | |
tree | 2f5f53e83399678e19f3895383f057e032a1609b /test/lisp/emacs-lisp | |
parent | e932395656b80cc30ba3a53d83bddf57339aef7d (diff) | |
download | emacs-67475a59e95919e2dbe25ae950450578afdfd0dc.tar.gz emacs-67475a59e95919e2dbe25ae950450578afdfd0dc.tar.bz2 emacs-67475a59e95919e2dbe25ae950450578afdfd0dc.zip |
Fix timer.el minor rounding error
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Fix rounding error by using integers rather than floats.
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
New test.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/timer-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/timer-tests.el b/test/lisp/emacs-lisp/timer-tests.el index 65e5dc9bde9..fa92c1b64aa 100644 --- a/test/lisp/emacs-lisp/timer-tests.el +++ b/test/lisp/emacs-lisp/timer-tests.el @@ -39,4 +39,9 @@ (if (fboundp 'debug-timer-check) (should (debug-timer-check)) t)) +(ert-deftest timer-test-multiple-of-time () + (should (equal + (timer-next-integral-multiple-of-time '(0 0 0 1) (1+ (ash 1 53))) + (list (ash 1 (- 53 16)) 1 0 0)))) + ;;; timer-tests.el ends here |