quickcheck: size limit randomly generated Benc structures master
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Fri, 8 Sep 2017 04:38:53 +0000 (10:08 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Fri, 8 Sep 2017 04:38:53 +0000 (10:08 +0530)
functorrent.cabal
src/FuncTorrent/Bencode.hs

index 50bd270cbe3f16027bfed70c303183b9ae89bd58..5e71ebfa93526c76ed186dc913360270ab655d82 100644 (file)
@@ -81,7 +81,9 @@ test-suite functorrent-test
   default-language:  Haskell2010
   hs-source-dirs:    test
   main-is:           Main.hs
-  other-modules:     MagneturiTests
+  other-modules:     BencodeTests
+                   , MagneturiTests
+                   , MetainfoTests
   build-depends:     base
                    , bytestring
                    , functorrent
index ac6221119663077f83aeb17757d26a7afc057926..b55b3fe15509e5e4745a5451fd9509d842eb7c05 100644 (file)
@@ -59,9 +59,9 @@ instance Arbitrary BVal where
                                , Bstr <$> arbitrary]
                 bval n = oneof [ Bint <$> arbitrary
                                , Bstr <$> arbitrary
-                               , Blist <$> vectorOf n (bval (n `div` 4))
-                               , do keys <- vectorOf n genNonEmptyString
-                                    vals <- vectorOf n (bval (n `div` 4))
+                               , Blist <$> vectorOf (n `div` 2) (bval (n `div` 4))
+                               , do keys <- vectorOf (n `div` 2) genNonEmptyString
+                                    vals <- vectorOf (n `div` 2) (bval (n `div` 4))
                                     return $ Bdict $ fromList $ zip keys vals ]
 
 -- getters