aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-06-17 22:20:11 +0200
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-06-17 22:20:11 +0200
commit36696695692ae816e8a3d442b7647e3aba1feba5 (patch)
tree4a06bc97e2e1091657e8884022407ee8ecea3add /test
parentminor native sources cleanup (diff)
allow constructing your own date/tm values
Diffstat (limited to 'test')
-rw-r--r--test/02-api.janet8
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))))