aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/world/time/day.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/world/time/day.lux91
1 files changed, 52 insertions, 39 deletions
diff --git a/stdlib/source/test/lux/world/time/day.lux b/stdlib/source/test/lux/world/time/day.lux
index c6471ffae..a893a1405 100644
--- a/stdlib/source/test/lux/world/time/day.lux
+++ b/stdlib/source/test/lux/world/time/day.lux
@@ -45,46 +45,59 @@
[expected ..random
invalid (random.only (predicate.or (n.< (/.number {/.#Sunday}))
(n.> (/.number {/.#Saturday})))
- random.nat)]
- (all _.and
- (_.for [/.equivalence]
- ($equivalence.spec /.equivalence ..random))
- (_.for [/.hash]
- ($hash.spec /.hash ..random))
- (_.for [/.order]
- ($order.spec /.order ..random))
- (_.for [/.enum]
- ($enum.spec /.enum ..random))
- (_.for [/.codec]
- ($codec.spec /.equivalence /.codec ..random))
+ random.nat)])
+ (`` (all _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+ (_.for [/.hash]
+ ($hash.spec /.hash ..random))
+ (_.for [/.order]
+ ($order.spec /.order ..random))
+ (_.for [/.enum]
+ ($enum.spec /.enum ..random))
+ (_.for [/.codec]
+ ($codec.spec /.equivalence /.codec ..random))
- (do random.monad
- [not_a_day (random.upper_case 1)]
- (_.coverage [/.not_a_day_of_the_week]
- (when (at /.codec decoded not_a_day)
+ (,, (with_template [<before> <current> <after>]
+ [(_.coverage [<current>]
+ (and (at /.equivalence = {<before>} (at /.enum pred {<current>}))
+ (at /.equivalence = {<after>} (at /.enum succ {<current>}))))]
+
+ [/.#Saturday /.#Sunday /.#Monday]
+ [/.#Sunday /.#Monday /.#Tuesday]
+ [/.#Monday /.#Tuesday /.#Wednesday]
+ [/.#Tuesday /.#Wednesday /.#Thursday]
+ [/.#Wednesday /.#Thursday /.#Friday]
+ [/.#Thursday /.#Friday /.#Saturday]
+ [/.#Friday /.#Saturday /.#Sunday]
+ ))
+ (do random.monad
+ [not_a_day (random.upper_case 1)]
+ (_.coverage [/.not_a_day_of_the_week]
+ (when (at /.codec decoded not_a_day)
+ {try.#Failure error}
+ (exception.match? /.not_a_day_of_the_week error)
+
+ {try.#Success _}
+ false)))
+ (_.coverage [/.number /.by_number]
+ (|> expected
+ /.number
+ /.by_number
+ (try#each (at /.equivalence = expected))
+ (try.else false)))
+ (_.coverage [/.invalid_day]
+ (when (/.by_number invalid)
{try.#Failure error}
- (exception.match? /.not_a_day_of_the_week error)
+ (exception.match? /.invalid_day error)
{try.#Success _}
- false)))
- (_.coverage [/.number /.by_number]
- (|> expected
- /.number
- /.by_number
- (try#each (at /.equivalence = expected))
- (try.else false)))
- (_.coverage [/.invalid_day]
- (when (/.by_number invalid)
- {try.#Failure error}
- (exception.match? /.invalid_day error)
-
- {try.#Success _}
- false))
- (_.coverage [/.week]
- (let [all (list.size /.week)
- uniques (set.size (set.of_list /.hash /.week))]
- (and (n.= (/.number {/.#Saturday})
- all)
- (n.= all
- uniques))))
- ))))
+ false))
+ (_.coverage [/.week]
+ (let [all (list.size /.week)
+ uniques (set.size (set.of_list /.hash /.week))]
+ (and (n.= (/.number {/.#Saturday})
+ all)
+ (n.= all
+ uniques))))
+ ))))