aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2021-12-05 17:44:02 -0800
committerPaul Eggert2021-12-05 23:24:08 -0800
commit83fa35bb16a219faba6f2c793dd0fce83833a5ec (patch)
tree532947371f06fcee015c394aa44b832af786de28
parent0d88c3c340ec09f449a2a843205cdcabae799fe1 (diff)
downloademacs-83fa35bb16a219faba6f2c793dd0fce83833a5ec.tar.gz
emacs-83fa35bb16a219faba6f2c793dd0fce83833a5ec.zip
Use time-equal-p to compare timestamps in tests
* test/lisp/calendar/time-date-tests.el (test-days-to-time) (test-time-since): Use time-equal-p to compare timestamps, since the default form shouldn’t matter.
-rw-r--r--test/lisp/calendar/time-date-tests.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el
index d5269804ad2..ed842e34fd6 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -55,13 +55,13 @@
55 (should (date-leap-year-p 2004))) 55 (should (date-leap-year-p 2004)))
56 56
57(ert-deftest test-days-to-time () 57(ert-deftest test-days-to-time ()
58 (should (equal (days-to-time 0) '(0 0))) 58 (should (time-equal-p (days-to-time 0) '(0 0)))
59 (should (equal (days-to-time 1) '(1 20864))) 59 (should (time-equal-p (days-to-time 1) '(1 20864)))
60 (should (equal (days-to-time 999) '(1317 2688))) 60 (should (time-equal-p (days-to-time 999) '(1317 2688)))
61 (should (equal (days-to-time 0.0) '(0 0 0 0))) 61 (should (time-equal-p (days-to-time 0.0) '(0 0 0 0)))
62 (should (equal (days-to-time 0.5) '(0 43200 0 0))) 62 (should (time-equal-p (days-to-time 0.5) '(0 43200 0 0)))
63 (should (equal (days-to-time 1.0) '(1 20864 0 0))) 63 (should (time-equal-p (days-to-time 1.0) '(1 20864 0 0)))
64 (should (equal (days-to-time 999.0) '(1317 2688 0 0)))) 64 (should (time-equal-p (days-to-time 999.0) '(1317 2688 0 0))))
65 65
66(ert-deftest test-seconds-to-string () 66(ert-deftest test-seconds-to-string ()
67 (should (equal (seconds-to-string 0) "0s")) 67 (should (equal (seconds-to-string 0) "0s"))
@@ -170,7 +170,8 @@
170 170
171(ert-deftest test-time-since () 171(ert-deftest test-time-since ()
172 (should (time-equal-p 0 (time-since nil))) 172 (should (time-equal-p 0 (time-since nil)))
173 (should (= (cadr (time-since (time-subtract (current-time) 1))) 1))) 173 (should (time-equal-p 1 (time-convert (time-since (time-subtract nil 1))
174 'integer))))
174 175
175(ert-deftest test-time-decoded-period () 176(ert-deftest test-time-decoded-period ()
176 (should (equal (decoded-time-period '(nil nil 1 nil nil nil nil nil nil)) 177 (should (equal (decoded-time-period '(nil nil 1 nil nil nil nil nil nil))