diff options
Diffstat (limited to 'stdlib/source/test/lux/abstract/order.lux')
-rw-r--r-- | stdlib/source/test/lux/abstract/order.lux | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/stdlib/source/test/lux/abstract/order.lux b/stdlib/source/test/lux/abstract/order.lux index ed64b5d46..a92dd06ad 100644 --- a/stdlib/source/test/lux/abstract/order.lux +++ b/stdlib/source/test/lux/abstract/order.lux @@ -1,43 +1,42 @@ (.module: [lux #* ["_" test (#+ Test)] - [abstract/monad (#+ do)] + [abstract + [monad (#+ do)]] [data - [text - ["%" format (#+ format)]] [number ["n" nat]]] [math - ["r" random (#+ Random)]]] + ["." random (#+ Random)]]] {1 ["." / (#+ Order)]}) (def: #export test Test - (<| (_.context (%.name (name-of /.Order))) - (do r.monad - [left r.nat - right (|> r.nat (r.filter (|>> (n.= left) not)))]) + (<| (_.covering /._) + (do random.monad + [left random.nat + right (|> random.nat (random.filter (|>> (n.= left) not)))]) ($_ _.and - (_.test (format (%.name (name-of /.min)) " &&& " (%.name (name-of /.max))) - (n.< (/.max n.order left right) - (/.min n.order left right))) + (_.cover [/.Choice /.min /.max] + (n.< (/.max n.order left right) + (/.min n.order left right))) ))) -(def: #export (spec (^open ",@.") generator) +(def: #export (spec (^open "/@.") generator) (All [a] (-> (Order a) (Random a) Test)) - (<| (_.context (%.name (name-of /.Order))) - (do r.monad + (<| (_.with-cover [/.Order]) + (do random.monad [parameter generator subject generator]) ($_ _.and (_.test "Values are either ordered, or they are equal. All options are mutually exclusive." - (cond (,@< parameter subject) - (not (or (,@< subject parameter) - (,@= parameter subject))) + (cond (/@< parameter subject) + (not (or (/@< subject parameter) + (/@= parameter subject))) - (,@< subject parameter) - (not (,@= parameter subject)) + (/@< subject parameter) + (not (/@= parameter subject)) ## else - (,@= parameter subject)))))) + (/@= parameter subject)))))) |