summaryrefslogtreecommitdiff
path: root/tests/Encoding.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-06-07 03:37:11 +0400
committerSam T <pxqr.sta@gmail.com>2013-06-07 03:37:11 +0400
commit095f22bba763aba8303322b104ae39e2ff2807c2 (patch)
tree2743e5c025e6934b247cee593fd693c23bb01892 /tests/Encoding.hs
parent558616b7dcc8955ab08fe8b194cdd5e128aba3f4 (diff)
~ Fix bug in torrent bencode instance.
Also add encoding tests for torrent module.
Diffstat (limited to 'tests/Encoding.hs')
-rw-r--r--tests/Encoding.hs11
1 files changed, 6 insertions, 5 deletions
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
48 , pure Unchoke 48 , pure Unchoke
49 , pure Interested 49 , pure Interested
50 , pure NotInterested 50 , pure NotInterested
51 , Have <$> positive 51 , Have <$> positive
52 , Bitfield <$> arbitrary 52 , Bitfield <$> arbitrary
53 , Request <$> arbitrary 53 , Request <$> arbitrary
54 , Piece <$> arbitrary 54 , Piece <$> arbitrary
55 , Cancel <$> arbitrary 55 , Cancel <$> arbitrary
56 , Port <$> arbitrary 56 , Port <$> arbitrary
57 ] 57 ]
58 58
59instance Arbitrary PeerID where 59instance Arbitrary PeerID where
@@ -67,6 +67,7 @@ instance Arbitrary InfoHash where
67instance Arbitrary Handshake where 67instance Arbitrary Handshake where
68 arbitrary = defaultHandshake <$> arbitrary <*> arbitrary 68 arbitrary = defaultHandshake <$> arbitrary <*> arbitrary
69 69
70
70data T a = T 71data T a = T
71 72
72prop_encoding :: (Serialize a, Eq a) => T a -> [a] -> Bool 73prop_encoding :: (Serialize a, Eq a) => T a -> [a] -> Bool