summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-25 21:41:15 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-25 21:41:15 +0400
commit5e92eec501e0a1ca6d09a01e078cf54ff3277273 (patch)
tree09879470eb7a5cd73c80bd2c84e589bd7e58b052 /tests
parent12769d2f1cfc29e08c4e451d3b65db81cfeb9cac (diff)
~ Use PortNumber instead of Word16 in Port message.
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