1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-29 16:30:19 +02:00

Fix tests for SRFI-19 date->string ~N

This commit is contained in:
Daniel Llorens 2018-12-12 08:01:05 +01:00
parent f74cfce4f1
commit 901bfef592

View file

@ -177,14 +177,18 @@ incomplete numerical tower implementation.)"
(date->string date)))) (date->string date))))
(pass-if "string->date understands nanoseconds (1)" (pass-if "string->date understands nanoseconds (1)"
(time=? (date->time-utc (string->date "2018-12-10 10:53:24.189" (let ((date (string->date "2018-12-10 10:53:24.189"
"~Y-~m-~d ~H:~M:~S.~N")) "~Y-~m-~d ~H:~M:~S.~N")))
(date->time-utc (make-date 189000000 24 53 10 10 12 2018 3600)))) (time=? (date->time-utc date)
(date->time-utc (make-date 189000000 24 53 10 10 12 2018
(date-zone-offset date))))))
(pass-if "string->date understands nanoseconds (2)" (pass-if "string->date understands nanoseconds (2)"
(time=? (date->time-utc (string->date "2018-12-10 10:53:24.189654321" (let ((date (string->date "2018-12-10 10:53:24.189654321"
"~Y-~m-~d ~H:~M:~S.~N")) "~Y-~m-~d ~H:~M:~S.~N")))
(date->time-utc (make-date 189654321 24 53 10 10 12 2018 3600)))) (time=? (date->time-utc date)
(date->time-utc (make-date 189654321 24 53 10 10 12 2018
(date-zone-offset date))))))
(pass-if "date->string pads small nanoseconds values correctly" (pass-if "date->string pads small nanoseconds values correctly"
(let* ((date (make-date 99999999 5 34 12 26 3 2017 0))) (let* ((date (make-date 99999999 5 34 12 26 3 2017 0)))