summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2019-04-24 13:17:53 +0200
committerPhilipp Stephani <phst@google.com>2019-04-24 13:17:53 +0200
commit534c33cf375182c97291d2dd242f936df5953321 (patch)
treea36d85bbc81ad93397bd9f81e962274ccb08f7ef /test
parente290a7d1730c99010272bbff7f497c3041cef46d (diff)
downloademacs-534c33cf375182c97291d2dd242f936df5953321.tar.gz
Fix return type of make_time.
make_time is documented to return a (TICKS . HZ) pair, so we can’t use make_lisp_time. Introduce a new conversion function instead. * src/emacs-module.c (module_make_time): Use timespec_to_lisp to correct return type. * src/timefns.c (timespec_to_lisp): New function. (make_lisp_time): Use it. * test/src/emacs-module-tests.el (mod-test-add-nanosecond/valid): Check return type.
Diffstat (limited to 'test')
-rw-r--r--test/src/emacs-module-tests.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 78f238140da..9eb38cd4548 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -326,8 +326,12 @@ Interactively, you can try hitting \\[keyboard-quit] to quit."
;; New (TICKS . HZ) format.
'(123456789 . 1000000000)))
(ert-info ((format "input: %s" input))
- (should (time-equal-p (mod-test-add-nanosecond input)
- (time-add input '(0 0 0 1000)))))))
+ (let ((result (mod-test-add-nanosecond input)))
+ (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))))))))
(ert-deftest mod-test-add-nanosecond/nil ()
(should (<= (float-time (mod-test-add-nanosecond nil))