aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/data
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r--stdlib/source/test/lux/data/sum.lux53
1 files changed, 24 insertions, 29 deletions
diff --git a/stdlib/source/test/lux/data/sum.lux b/stdlib/source/test/lux/data/sum.lux
index 73ffe0e21..2aa3c5058 100644
--- a/stdlib/source/test/lux/data/sum.lux
+++ b/stdlib/source/test/lux/data/sum.lux
@@ -1,24 +1,25 @@
(.using
- [library
- [lux "*"
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]
- [\\specification
- ["$[0]" equivalence]]]
- [control
- pipe]
- [data
- ["[0]" text]
- [collection
- ["[0]" list ("[1]#[0]" functor)]]]
- [math
- ["[0]" random]
- [number
- ["n" nat]
- ["i" int]]]]]
- [\\library
- ["[0]" /]])
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" hash]]]
+ [control
+ pipe]
+ [data
+ ["[0]" text]
+ [collection
+ ["[0]" list ("[1]#[0]" functor)]]]
+ [math
+ ["[0]" random]
+ [number
+ ["n" nat]
+ ["i" int]]]]]
+ [\\library
+ ["[0]" /]])
(def: .public test
Test
@@ -31,15 +32,9 @@
(_.for [/.equivalence]
($equivalence.spec (/.equivalence n.equivalence n.equivalence)
(random.or random.nat random.nat)))
- (do random.monad
- [left random.int
- right random.nat]
- (_.cover [/.hash]
- (let [hash (/.hash i.hash n.hash)]
- (and (n.= (# i.hash hash left)
- (# hash hash {.#Left left}))
- (n.= (# n.hash hash right)
- (# hash hash {.#Right right}))))))
+ (_.for [/.hash]
+ ($hash.spec (/.hash n.hash n.hash)
+ (random.or random.nat random.nat)))
(_.cover [/.left]
(|> (/.left expected)