diff options
Diffstat (limited to 'stdlib/source/test/lux/data')
-rw-r--r-- | stdlib/source/test/lux/data/collection/list.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/set.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/collection/set/multi.lux | 8 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/maybe.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/name.lux | 5 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/text.lux | 4 |
6 files changed, 31 insertions, 1 deletions
diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index 6306f62fc..3efc42254 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -7,6 +7,7 @@ {[0 #spec] [/ ["$." equivalence] + ["$." hash] ["$." monoid] ["$." fold] ["$." functor] @@ -49,6 +50,10 @@ ($_ _.and (_.for [/.equivalence] ($equivalence.spec (/.equivalence n.equivalence) ..random)) + (_.for [/.hash] + (|> random.nat + (\ random.monad map (|>> list)) + ($hash.spec (/.hash n.hash)))) (_.for [/.monoid] ($monoid.spec (/.equivalence n.equivalence) /.monoid ..random)) (_.for [/.fold] diff --git a/stdlib/source/test/lux/data/collection/set.lux b/stdlib/source/test/lux/data/collection/set.lux index 6f981af91..282749f5e 100644 --- a/stdlib/source/test/lux/data/collection/set.lux +++ b/stdlib/source/test/lux/data/collection/set.lux @@ -7,6 +7,7 @@ {[0 #spec] [/ ["$." equivalence] + ["$." hash] ["$." monoid]]}] [data ["." bit ("#\." equivalence)] @@ -33,6 +34,10 @@ ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence (random.set n.hash size random.nat))) + (_.for [/.hash] + (|> random.nat + (\ random.monad map (|>> list (/.from_list n.hash))) + ($hash.spec /.hash))) (_.for [/.monoid] ($monoid.spec /.equivalence (/.monoid n.hash) (random.set n.hash size random.nat))) diff --git a/stdlib/source/test/lux/data/collection/set/multi.lux b/stdlib/source/test/lux/data/collection/set/multi.lux index 9d9572795..718c971c3 100644 --- a/stdlib/source/test/lux/data/collection/set/multi.lux +++ b/stdlib/source/test/lux/data/collection/set/multi.lux @@ -7,7 +7,8 @@ ["." predicate] {[0 #spec] [/ - ["$." equivalence]]}] + ["$." equivalence] + ["$." hash]]}] [data ["." bit ("#\." equivalence)] [collection @@ -50,6 +51,11 @@ (`` ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence (..random diversity n.hash ..count random.nat))) + (_.for [/.hash] + (|> random.nat + (\ random.monad map (function (_ single) + (/.add 1 single (/.new n.hash)))) + ($hash.spec /.hash))) (_.cover [/.to_list /.from_list] (|> sample diff --git a/stdlib/source/test/lux/data/maybe.lux b/stdlib/source/test/lux/data/maybe.lux index 64f9b5ff5..017d0799b 100644 --- a/stdlib/source/test/lux/data/maybe.lux +++ b/stdlib/source/test/lux/data/maybe.lux @@ -6,6 +6,7 @@ {[0 #spec] [/ ["$." equivalence] + ["$." hash] ["$." monoid] ["$." functor] ["$." apply] @@ -31,6 +32,10 @@ ($_ _.and (_.for [/.equivalence] ($equivalence.spec (/.equivalence n.equivalence) (random.maybe random.nat))) + (_.for [/.hash] + (|> random.nat + (\ random.monad map (|>> #.Some)) + ($hash.spec (/.hash n.hash)))) (_.for [/.monoid] ($monoid.spec (/.equivalence n.equivalence) /.monoid (random.maybe random.nat))) (_.for [/.functor] diff --git a/stdlib/source/test/lux/data/name.lux b/stdlib/source/test/lux/data/name.lux index 7912994c3..f68a58d9a 100644 --- a/stdlib/source/test/lux/data/name.lux +++ b/stdlib/source/test/lux/data/name.lux @@ -6,6 +6,7 @@ {[0 #spec] [/ ["$." equivalence] + ["$." hash] ["$." order] ["$." codec]]}] [control @@ -45,6 +46,10 @@ ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence (..random sizeM1 sizeS1))) + (_.for [/.hash] + (|> (random.ascii 2) + (\ ! map (|>> [""])) + ($hash.spec /.hash))) (_.for [/.order] ($order.spec /.order (..random sizeM1 sizeS1))) (_.for [/.codec] diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux index a5d11685f..c89ca97ba 100644 --- a/stdlib/source/test/lux/data/text.lux +++ b/stdlib/source/test/lux/data/text.lux @@ -6,6 +6,7 @@ {[0 #spec] [/ ["$." equivalence] + ["$." hash] ["$." order] ["$." monoid]]}] [control @@ -238,6 +239,9 @@ ($_ _.and (_.for [/.equivalence] ($equivalence.spec /.equivalence (random.ascii 2))) + (_.for [/.hash] + (|> (random.ascii 2) + ($hash.spec /.hash))) (_.for [/.order] ($order.spec /.order (random.ascii 2))) (_.for [/.monoid] |