diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-24 19:13:34 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-24 19:15:23 -0700 |
commit | d0c77a189423dbf648ca5ae9d831a5a2e04e6947 (patch) | |
tree | 0c4cf84c21071605699678116a28ebf8eadd2c3d /test/lisp/emacs-lisp | |
parent | 19ab7686ae42dcce1e0861bce4713c69a64eec45 (diff) | |
download | emacs-d0c77a189423dbf648ca5ae9d831a5a2e04e6947.tar.gz emacs-d0c77a189423dbf648ca5ae9d831a5a2e04e6947.tar.bz2 emacs-d0c77a189423dbf648ca5ae9d831a5a2e04e6947.zip |
Remove some assumptions about timestamp format
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.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r-- | test/lisp/emacs-lisp/timer-tests.el | 8 |
1 files changed, 5 insertions, 3 deletions
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 |