Use noDupsList generator for more tests

This commit is contained in:
David Pätzel 2019-10-19 15:57:55 +02:00
parent 36999532c2
commit 2a9459f226

View File

@ -182,15 +182,17 @@ unique xs = length xs == (length . nub) xs
prop_valid_empty = valid []
prop_valid_dupNoT ss = unique ss ==> valid (ss `zip` repeat NoT)
prop_valid_dupNoT =
forAll noDupsList $ \ss ->
valid (ss `zip` repeat NoT)
prop_valid_dupT ss ts =
unique ss
&& unique ts
&& length ss > length ts
&& not (null ts)
&& NoT `notElem` ts
==> not . valid $ ss `zip` cycle ts
prop_valid_dupT =
forAll noDupsList $ \ss ->
forAll noDupsList $ \ts' ->
let ts = filter (/= NoT) ts'
in length ss > length ts && not (null ts)
==> not . valid
$ ss `zip` cycle ts
prop_valid_noDups =
forAll noDupsList $ \ss ->