From 06e2814e1f3a80d247675319d3c438989592fb06 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 27 Sep 2018 18:28:27 -0700 Subject: time-equal, and time values of infinity and NaN * doc/lispref/os.texi (Time Calculations): Document time-equal, and the behavior on NaNs and infinities of time-less-p, time-add, time-subtract. * etc/NEWS: Mention the change. * src/editfns.c (time_arith): Change last arg from function to bool. All callers changed. Do the right thing with infinities and NaNs. (time_cmp): New function, which handlesx infinities and NaNs. (Ftime_less_p): Use it. (Ftime_equal): New function. * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time): Use it. --- test/lisp/emacs-lisp/timer-tests.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test/lisp/emacs-lisp/timer-tests.el') diff --git a/test/lisp/emacs-lisp/timer-tests.el b/test/lisp/emacs-lisp/timer-tests.el index 1d3ba757f63..0e40cdf442f 100644 --- a/test/lisp/emacs-lisp/timer-tests.el +++ b/test/lisp/emacs-lisp/timer-tests.el @@ -40,10 +40,8 @@ (should (debug-timer-check)) t)) (ert-deftest timer-test-multiple-of-time () - (should (zerop - (float-time - (time-subtract - (timer-next-integral-multiple-of-time '(0 0 0 1) (1+ (ash 1 53))) - (list (ash 1 (- 53 16)) 1)))))) + (should (time-equal + (timer-next-integral-multiple-of-time '(0 0 0 1) (1+ (ash 1 53))) + (list (ash 1 (- 53 16)) 1)))) ;;; timer-tests.el ends here -- cgit v1.2.3