summaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/timefns-tests.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el
index fae058edf93..feb8fc7905e 100644
--- a/test/src/timefns-tests.el
+++ b/test/src/timefns-tests.el
@@ -40,23 +40,25 @@
(7879679999900 . 100000)
(78796799999999999999 . 1000000000000)))
;; UTC.
+ (let ((subsec (time-subtract (time-convert look t)
+ (time-convert look 'integer))))
(should (string-equal
(format-time-string "%Y-%m-%d %H:%M:%S.%3N %z" look t)
"1972-06-30 23:59:59.999 +0000"))
(should (equal (decode-time look t)
- '(59 59 23 30 6 1972 5 nil 0)))
+ (list 59 59 23 30 6 1972 5 nil 0 subsec)))
;; "UTC0".
(should (string-equal
(format-time-string format look "UTC0")
"1972-06-30 23:59:59.999 +0000 (UTC)"))
(should (equal (decode-time look "UTC0")
- '(59 59 23 30 6 1972 5 nil 0)))
+ (list 59 59 23 30 6 1972 5 nil 0 subsec)))
;; Negative UTC offset, as a Lisp list.
(should (string-equal
(format-time-string format look '(-28800 "PST"))
"1972-06-30 15:59:59.999 -0800 (PST)"))
(should (equal (decode-time look '(-28800 "PST"))
- '(59 59 15 30 6 1972 5 nil -28800)))
+ (list 59 59 15 30 6 1972 5 nil -28800 subsec)))
;; Negative UTC offset, as a Lisp integer.
(should (string-equal
(format-time-string format look -28800)
@@ -66,13 +68,13 @@
"1972-06-30 15:59:59.999 -0800 (ZZZ)"
"1972-06-30 15:59:59.999 -0800 (-08)")))
(should (equal (decode-time look -28800)
- '(59 59 15 30 6 1972 5 nil -28800)))
+ (list 59 59 15 30 6 1972 5 nil -28800 subsec)))
;; Positive UTC offset that is not an hour multiple, as a string.
(should (string-equal
(format-time-string format look "IST-5:30")
"1972-07-01 05:29:59.999 +0530 (IST)"))
(should (equal (decode-time look "IST-5:30")
- '(59 29 5 1 7 1972 6 nil 19800))))))
+ (list 59 29 5 1 7 1972 6 nil 19800 subsec)))))))
(ert-deftest decode-then-encode-time ()
(let ((time-values (list 0 -2 1 0.0 -0.0 -2.0 1.0
@@ -146,5 +148,5 @@
(ert-deftest encode-time-dst-numeric-zone ()
"Check for Bug#35502."
(should (time-equal-p
- (encode-time '(29 31 17 30 4 2019 2 t 7200))
+ (encode-time '(29 31 17 30 4 2019 2 t 7200 0))
'(23752 27217))))