summaryrefslogtreecommitdiff
path: root/Types/MetaData.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2019-01-21 13:40:11 -0400
committerJoey Hess <joeyh@joeyh.name>2019-01-21 13:50:24 -0400
commitf76c4a09739e150c01d8d6565d0b9c33c340b37f (patch)
tree18e2caf2ad6fccb0d79845b53c34faeffcb60263 /Types/MetaData.hs
parente15d18058b7326e61823db4c6d38c20bef691c92 (diff)
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.
Diffstat (limited to 'Types/MetaData.hs')
-rw-r--r--Types/MetaData.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Types/MetaData.hs b/Types/MetaData.hs
index bc7c3eea3e..fce941c576 100644
--- a/Types/MetaData.hs
+++ b/Types/MetaData.hs
@@ -337,9 +337,8 @@ fromRemoteMetaData (RemoteMetaData u (MetaData m)) = MetaData $
- the seriaization test slow due to the sheer amount of data.
- It's unlikely that more than 100 fields of metadata will be used. -}
instance Arbitrary MetaData where
- arbitrary = do
- size <- arbitrarySizedBoundedIntegral `suchThat` (< 500)
- MetaData . M.filterWithKey legal . M.fromList <$> vector size
+ arbitrary = MetaData . M.filterWithKey legal . M.fromList
+ <$> resize 10 (listOf arbitrary)
where
legal k _v = legalField $ fromMetaField k