From 095f22bba763aba8303322b104ae39e2ff2807c2 Mon Sep 17 00:00:00 2001 From: Sam T Date: Fri, 7 Jun 2013 03:37:11 +0400 Subject: ~ Fix bug in torrent bencode instance. Also add encoding tests for torrent module. --- tests/Encoding.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/Encoding.hs') diff --git a/tests/Encoding.hs b/tests/Encoding.hs index a599cd39..78f0dfc1 100644 --- a/tests/Encoding.hs +++ b/tests/Encoding.hs @@ -48,12 +48,12 @@ instance Arbitrary Message where , pure Unchoke , pure Interested , pure NotInterested - , Have <$> positive + , Have <$> positive , Bitfield <$> arbitrary - , Request <$> arbitrary - , Piece <$> arbitrary - , Cancel <$> arbitrary - , Port <$> arbitrary + , Request <$> arbitrary + , Piece <$> arbitrary + , Cancel <$> arbitrary + , Port <$> arbitrary ] instance Arbitrary PeerID where @@ -67,6 +67,7 @@ instance Arbitrary InfoHash where instance Arbitrary Handshake where arbitrary = defaultHandshake <$> arbitrary <*> arbitrary + data T a = T prop_encoding :: (Serialize a, Eq a) => T a -> [a] -> Bool -- cgit v1.2.3