summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/emacs-module-tests.el7
-rw-r--r--test/src/timefns-tests.el3
2 files changed, 8 insertions, 2 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index c44c386d30b..c5107847318 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -335,12 +335,15 @@ Interactively, you can try hitting \\[keyboard-quit] to quit."
;; New (TICKS . HZ) format.
'(123456789 . 1000000000)))
(ert-info ((format "input: %s" input))
- (let ((result (mod-test-add-nanosecond input)))
+ (let ((result (mod-test-add-nanosecond input))
+ (desired-result
+ (let ((hz 1000000000))
+ (time-add (time-convert input hz) (cons 1 hz)))))
(should (consp result))
(should (integerp (car result)))
(should (integerp (cdr result)))
(should (cl-plusp (cdr result)))
- (should (time-equal-p result (time-add input '(0 0 0 1000))))))))
+ (should (time-equal-p result desired-result))))))
(ert-deftest mod-test-add-nanosecond/nil ()
(should (<= (float-time (mod-test-add-nanosecond nil))
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el
index 1b1032deaa1..362e7655a91 100644
--- a/test/src/timefns-tests.el
+++ b/test/src/timefns-tests.el
@@ -145,6 +145,9 @@
(< 0.99 (/ (- (float-time a)) (float-time b))
1.01))))))))
+(ert-deftest time-rounding-tests ()
+ (should (time-equal-p 1e-13 (time-add 0 1e-13))))
+
(ert-deftest encode-time-dst-numeric-zone ()
"Check for Bug#35502."
(should (time-equal-p