diff options
| author | 2023-06-17 22:20:11 +0200 | |
|---|---|---|
| committer | 2023-06-17 22:20:11 +0200 | |
| commit | 36696695692ae816e8a3d442b7647e3aba1feba5 (patch) | |
| tree | 4a06bc97e2e1091657e8884022407ee8ecea3add /test | |
| parent | minor native sources cleanup (diff) | |
allow constructing your own date/tm values
Diffstat (limited to 'test')
| -rw-r--r-- | test/02-api.janet | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/02-api.janet b/test/02-api.janet index eb0666f..2a9c0ec 100644 --- a/test/02-api.janet +++ b/test/02-api.janet @@ -19,3 +19,11 @@ (assert (date/format now :default true)) # format string (assert (date/format now :%c)) + +# ensure tm + gmtime are spec-compliant +(def u (date/utc {:year 1970})) +(def l (date/local {:year 1970})) +(assert (= u + (:gmtime (:timegm u)))) +(assert (= l + (:localtime (:mktime l)))) |
