aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/time/instant.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/time/instant.lux51
1 files changed, 26 insertions, 25 deletions
diff --git a/stdlib/source/test/lux/time/instant.lux b/stdlib/source/test/lux/time/instant.lux
index ec4a9456c..9b903d993 100644
--- a/stdlib/source/test/lux/time/instant.lux
+++ b/stdlib/source/test/lux/time/instant.lux
@@ -31,29 +31,30 @@
(def: #export test
Test
- ($_ _.and
- ($equivalence.spec /.equivalence ..instant)
- ($order.spec /.order ..instant)
- ($enum.spec /.enum ..instant)
- ## TODO; Uncomment ASAP
- ## ($codec.spec /.equivalence /.codec ..instant)
+ (<| (_.context (%name (name-of /._)))
+ ($_ _.and
+ ($equivalence.spec /.equivalence ..instant)
+ ($order.spec /.order ..instant)
+ ($enum.spec /.enum ..instant)
+ ## TODO; Uncomment ASAP
+ ## ($codec.spec /.equivalence /.codec ..instant)
- (do r.monad
- [millis r.int]
- (_.test "Can convert from/to milliseconds."
- (|> millis /.from-millis /.to-millis (i/= millis))))
- (do r.monad
- [sample instant
- span _duration.duration
- #let [(^open "@/.") /.equivalence
- (^open "@d/.") @d.equivalence]]
- ($_ _.and
- (_.test "The span of a instant and itself has an empty duration."
- (|> sample (/.span sample) (@d/= @d.empty)))
- (_.test "Can shift a instant by a duration."
- (|> sample (/.shift span) (/.span sample) (@d/= span)))
- (_.test "Can obtain the time-span between the epoch and an instant."
- (|> sample /.relative /.absolute (@/= sample)))
- (_.test "All instants are relative to the epoch."
- (|> /.epoch (/.shift (/.relative sample)) (@/= sample)))))
- ))
+ (do r.monad
+ [millis r.int]
+ (_.test "Can convert from/to milliseconds."
+ (|> millis /.from-millis /.to-millis (i/= millis))))
+ (do r.monad
+ [sample instant
+ span _duration.duration
+ #let [(^open "@/.") /.equivalence
+ (^open "@d/.") @d.equivalence]]
+ ($_ _.and
+ (_.test "The span of a instant and itself has an empty duration."
+ (|> sample (/.span sample) (@d/= @d.empty)))
+ (_.test "Can shift a instant by a duration."
+ (|> sample (/.shift span) (/.span sample) (@d/= span)))
+ (_.test "Can obtain the time-span between the epoch and an instant."
+ (|> sample /.relative /.absolute (@/= sample)))
+ (_.test "All instants are relative to the epoch."
+ (|> /.epoch (/.shift (/.relative sample)) (@/= sample)))))
+ )))