[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 83fa35b 02/13: Use time-equal-p to compare timestamps in tests
From: |
Paul Eggert |
Subject: |
master 83fa35b 02/13: Use time-equal-p to compare timestamps in tests |
Date: |
Mon, 6 Dec 2021 02:24:21 -0500 (EST) |
branch: master
commit 83fa35bb16a219faba6f2c793dd0fce83833a5ec
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
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.
---
test/lisp/calendar/time-date-tests.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/test/lisp/calendar/time-date-tests.el
b/test/lisp/calendar/time-date-tests.el
index d526980..ed842e3 100644
--- a/test/lisp/calendar/time-date-tests.el
+++ b/test/lisp/calendar/time-date-tests.el
@@ -55,13 +55,13 @@
(should (date-leap-year-p 2004)))
(ert-deftest test-days-to-time ()
- (should (equal (days-to-time 0) '(0 0)))
- (should (equal (days-to-time 1) '(1 20864)))
- (should (equal (days-to-time 999) '(1317 2688)))
- (should (equal (days-to-time 0.0) '(0 0 0 0)))
- (should (equal (days-to-time 0.5) '(0 43200 0 0)))
- (should (equal (days-to-time 1.0) '(1 20864 0 0)))
- (should (equal (days-to-time 999.0) '(1317 2688 0 0))))
+ (should (time-equal-p (days-to-time 0) '(0 0)))
+ (should (time-equal-p (days-to-time 1) '(1 20864)))
+ (should (time-equal-p (days-to-time 999) '(1317 2688)))
+ (should (time-equal-p (days-to-time 0.0) '(0 0 0 0)))
+ (should (time-equal-p (days-to-time 0.5) '(0 43200 0 0)))
+ (should (time-equal-p (days-to-time 1.0) '(1 20864 0 0)))
+ (should (time-equal-p (days-to-time 999.0) '(1317 2688 0 0))))
(ert-deftest test-seconds-to-string ()
(should (equal (seconds-to-string 0) "0s"))
@@ -170,7 +170,8 @@
(ert-deftest test-time-since ()
(should (time-equal-p 0 (time-since nil)))
- (should (= (cadr (time-since (time-subtract (current-time) 1))) 1)))
+ (should (time-equal-p 1 (time-convert (time-since (time-subtract nil 1))
+ 'integer))))
(ert-deftest test-time-decoded-period ()
(should (equal (decoded-time-period '(nil nil 1 nil nil nil nil nil nil))
- master updated (4434dea -> c1145c3), Paul Eggert, 2021/12/06
- master c1145c3 13/13: Update org-compat doc string, Paul Eggert, 2021/12/06
- master 084f440 06/13: Simplify message-make-expires, Paul Eggert, 2021/12/06
- master dbef214 10/13: Simplify by using format-time-string, Paul Eggert, 2021/12/06
- master 83fa35b 02/13: Use time-equal-p to compare timestamps in tests,
Paul Eggert <=
- master 524c42f 04/13: Prefer nil to (current-time) when either will do, Paul Eggert, 2021/12/06
- master 19932c3 11/13: Avoid timestamp info loss in mh-alias-tstamp, Paul Eggert, 2021/12/06
- master 2bda029 07/13: Use time-convert in with-decoded-time-value, Paul Eggert, 2021/12/06
- master 15f20c0 09/13: Simplify RFC 5322 time zone generation, Paul Eggert, 2021/12/06
- master f4d7ca7 05/13: Simplify message-unique-id etc., Paul Eggert, 2021/12/06
- master 1866373 08/13: Fix image load timekeeping bug, Paul Eggert, 2021/12/06
- master af60618 03/13: Simplify cedet-utest-elapsed-time, Paul Eggert, 2021/12/06
- master 0d88c3c 01/13: Add time-convert tests, Paul Eggert, 2021/12/06
- master a21b8c5 12/13: Fix minor clock skew issues, Paul Eggert, 2021/12/06