avoid Arbitrary generating excessivly long lists
Turns what it was doing often generated too long lists, or spun with suchThat rejecting too large numbers. Limit lists to 10.
This commit is contained in:
parent
e15d18058b
commit
f76c4a0973
2 changed files with 5 additions and 6 deletions
|
@ -23,7 +23,8 @@ data View = View
|
|||
deriving (Eq, Read, Show)
|
||||
|
||||
instance Arbitrary View where
|
||||
arbitrary = View <$> pure (Git.Ref "master") <*> arbitrary
|
||||
arbitrary = View (Git.Ref "master")
|
||||
<$> resize 10 (listOf arbitrary)
|
||||
|
||||
data ViewComponent = ViewComponent
|
||||
{ viewField :: MetaField
|
||||
|
@ -43,8 +44,7 @@ data ViewFilter
|
|||
|
||||
instance Arbitrary ViewFilter where
|
||||
arbitrary = do
|
||||
size <- arbitrarySizedBoundedIntegral `suchThat` (< 100)
|
||||
s <- S.fromList <$> vector size
|
||||
s <- S.fromList <$> resize 10 (listOf arbitrary)
|
||||
ifM arbitrary
|
||||
( return (FilterValues s)
|
||||
, return (ExcludeValues s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue