summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Encoding.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/Encoding.hs b/tests/Encoding.hs
index fe0e1d7e..d43045bc 100644
--- a/tests/Encoding.hs
+++ b/tests/Encoding.hs
@@ -13,6 +13,8 @@ import Test.Framework.Providers.QuickCheck2 (testProperty)
13import Test.QuickCheck 13import Test.QuickCheck
14 14
15import Network.URI 15import Network.URI
16import Network
17
16 18
17import Data.Bitfield 19import Data.Bitfield
18import Data.Torrent 20import Data.Torrent
@@ -33,6 +35,9 @@ instance Arbitrary Block where
33 35
34deriving instance Arbitrary Bitfield 36deriving instance Arbitrary Bitfield
35 37
38instance Arbitrary PortNumber where
39 arbitrary = fromIntegral <$> (arbitrary :: Gen Word16)
40
36instance Arbitrary Message where 41instance Arbitrary Message where
37 arbitrary = oneof 42 arbitrary = oneof
38 [ pure KeepAlive 43 [ pure KeepAlive
@@ -45,7 +50,7 @@ instance Arbitrary Message where
45 , Request <$> arbitrary 50 , Request <$> arbitrary
46 , Piece <$> arbitrary 51 , Piece <$> arbitrary
47 , Cancel <$> arbitrary 52 , Cancel <$> arbitrary
48 , Port <$> choose (0, fromIntegral (maxBound :: Word16)) 53 , Port <$> arbitrary
49 ] 54 ]
50 55
51instance Arbitrary PeerID where 56instance Arbitrary PeerID where