From d0c77a189423dbf648ca5ae9d831a5a2e04e6947 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 24 Sep 2018 19:13:34 -0700 Subject: Remove some assumptions about timestamp format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These changes remove some assumptions of Lisp code on timestamp format. Although we’re not going to change the default format any time soon, I went looking for code that was too intimate about details of timestamp format and removed assumptions where this was easy to do with current Emacs primitives. * lisp/ido.el (ido-wash-history): Fix test for zero timestamp. * lisp/time.el (display-time-event-handler): Use time-less-p rather than doing it by hand. (display-time-update): Simplify by using float-time instead of doing the equivalent by hand. * lisp/url/url-auth.el (url-digest-auth-make-cnonce): * test/lisp/calendar/parse-time-tests.el (parse-time-tests): * test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time): * test/lisp/net/tramp-tests.el: (tramp-test19-directory-files-and-attributes) (tramp-test22-file-times, tramp-test23-visited-file-modtime): Don’t assume detailed format of returned Lisp timestamps. --- test/lisp/emacs-lisp/timer-tests.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/lisp/emacs-lisp') diff --git a/test/lisp/emacs-lisp/timer-tests.el b/test/lisp/emacs-lisp/timer-tests.el index fa92c1b64aa..1d3ba757f63 100644 --- a/test/lisp/emacs-lisp/timer-tests.el +++ b/test/lisp/emacs-lisp/timer-tests.el @@ -40,8 +40,10 @@ (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)))) + (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)))))) ;;; timer-tests.el ends here -- cgit v1.2.3