mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 04:15:36 +02:00
Support ~N in SRFI-19 string->date
* module/srfi/srfi-19.scm (fractional-integer-reader, make-fractional-integer-reader): From reference implementation. (reader-directives): Handle #\N, from reference implementation. * test-suite/tests/srfi-19: Add tests for string->date ~N. * doc/ref/srfi-modules.texi (string->date): Add line for ~N.
This commit is contained in:
parent
8e86dd93a0
commit
f74cfce4f1
3 changed files with 37 additions and 0 deletions
|
@ -176,6 +176,16 @@ incomplete numerical tower implementation.)"
|
|||
(equal? "Sun Jun 05 18:33:00+0200 2005"
|
||||
(date->string date))))
|
||||
|
||||
(pass-if "string->date understands nanoseconds (1)"
|
||||
(time=? (date->time-utc (string->date "2018-12-10 10:53:24.189"
|
||||
"~Y-~m-~d ~H:~M:~S.~N"))
|
||||
(date->time-utc (make-date 189000000 24 53 10 10 12 2018 3600))))
|
||||
|
||||
(pass-if "string->date understands nanoseconds (2)"
|
||||
(time=? (date->time-utc (string->date "2018-12-10 10:53:24.189654321"
|
||||
"~Y-~m-~d ~H:~M:~S.~N"))
|
||||
(date->time-utc (make-date 189654321 24 53 10 10 12 2018 3600))))
|
||||
|
||||
(pass-if "date->string pads small nanoseconds values correctly"
|
||||
(let* ((date (make-date 99999999 5 34 12 26 3 2017 0)))
|
||||
(equal? "099999999"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue