(.require [library [lux (.except) [abstract [monad (.only do)]] [control ["[0]" try] ["[0]" exception] ["[0]" io]] [data ["[0]" bit (.use "[1]#[0]" equivalence)] ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)]]] [math ["[0]" random (.only Random)] [number ["n" nat] ["i" int]]] [meta ["@" target]] [test ["_" property (.only Test)]]]] [\\library ["[0]" / (.only) [// ["[0]" duration] ["[0]" instant]]]]) (def .public test Test (<| (_.covering /._) (_.for [/.Instant]) (do random.monad [_ (in [])]) (all _.and (_.for [/.Zone] (_.coverage [/.local_zone] (io.run! (do io.monad [zone /.local_zone] (in (for @.lua ... Lua doesn't natively support getting the time-zone ID. (text.empty? zone) ... else (not (text.empty? zone)))))))) (_.coverage [/.now /.zone] (io.run! (do io.monad [zone /.local_zone it /.now] (in (text#= zone (/.zone it)))))) (_.coverage [/.format /.universal /.offset] (io.run! (do io.monad [zone /.local_zone it /.now] (in (text.starts_with? (instant.format (instant.after (/.offset it) (/.universal it))) (/.format it)))))) )))