From 308c77eccabe0f1f66959eac3bf0b1686570b0e8 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Sun, 26 Apr 2015 17:39:01 +0530 Subject: [PATCH] QuickCheck tests now terminate successfully. The trick is to reduce the amount of data we generate for recursive types. The hint is in the QuickCheck manual. --- src/FuncTorrent/Bencode.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FuncTorrent/Bencode.hs b/src/FuncTorrent/Bencode.hs index 8b6ff52..62d4767 100644 --- a/src/FuncTorrent/Bencode.hs +++ b/src/FuncTorrent/Bencode.hs @@ -38,9 +38,9 @@ instance Arbitrary BVal where , Bstr <$> arbitrary] bval n = oneof [ Bint <$> arbitrary , Bstr <$> arbitrary - , Blist <$> vectorOf n arbitrary + , Blist <$> vectorOf n (bval (n `div` 4)) , do keys <- vectorOf n arbitrary - vals <- vectorOf n arbitrary + vals <- vectorOf n (bval (n `div` 4)) return $ Bdict $ fromList $ zip keys vals ] -- getters -- 2.37.2