diff options
Diffstat (limited to 'tests/Network')
-rw-r--r-- | tests/Network/BitTorrent/Exchange/BlockSpec.hs | 9 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs | 2 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/tests/Network/BitTorrent/Exchange/BlockSpec.hs b/tests/Network/BitTorrent/Exchange/BlockSpec.hs index 158a30b4..f4301452 100644 --- a/tests/Network/BitTorrent/Exchange/BlockSpec.hs +++ b/tests/Network/BitTorrent/Exchange/BlockSpec.hs | |||
@@ -1,5 +1,6 @@ | |||
1 | module Network.BitTorrent.Exchange.BlockSpec (spec) where | 1 | module Network.BitTorrent.Exchange.BlockSpec (spec) where |
2 | import Control.Applicative | 2 | import Control.Applicative |
3 | import Data.Maybe | ||
3 | import Test.Hspec | 4 | import Test.Hspec |
4 | import Test.QuickCheck | 5 | import Test.QuickCheck |
5 | 6 | ||
@@ -12,8 +13,14 @@ instance Arbitrary a => Arbitrary (Block a) where | |||
12 | instance Arbitrary BlockIx where | 13 | instance Arbitrary BlockIx where |
13 | arbitrary = BlockIx <$> arbitrary <*> arbitrary <*> arbitrary | 14 | arbitrary = BlockIx <$> arbitrary <*> arbitrary <*> arbitrary |
14 | 15 | ||
16 | instance Arbitrary Bucket where | ||
17 | arbitrary = error "arbitrary: block bucket" | ||
18 | |||
19 | instance Show Bucket where | ||
20 | show = error "show: bucket" | ||
21 | |||
15 | spec :: Spec | 22 | spec :: Spec |
16 | spec = do | 23 | spec = do |
17 | describe "bucket" $ do | 24 | describe "bucket" $ do |
18 | it "render to piece when it is full" $ property $ \ bkt -> | 25 | it "render to piece when it is full" $ property $ \ bkt -> |
19 | if full bkt then isJust (toPiece bkt) \ No newline at end of file | 26 | full bkt == isJust (toPiece bkt) \ No newline at end of file |
diff --git a/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs index 6ff68cdf..37029b75 100644 --- a/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs +++ b/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs | |||
@@ -1,4 +1,4 @@ | |||
1 | module Network.BitTorrent.Tracker.RPC.HTTPSpec (spec) where | 1 | module Network.BitTorrent.Tracker.RPC.HTTPSpec (spec, trackerURIs) where |
2 | 2 | ||
3 | import Control.Monad | 3 | import Control.Monad |
4 | import Control.Monad.Trans | 4 | import Control.Monad.Trans |
diff --git a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs index 53babbb3..e46f15b6 100644 --- a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs +++ b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | |||
@@ -1,5 +1,5 @@ | |||
1 | {-# LANGUAGE RecordWildCards #-} | 1 | {-# LANGUAGE RecordWildCards #-} |
2 | module Network.BitTorrent.Tracker.RPC.UDPSpec (spec) where | 2 | module Network.BitTorrent.Tracker.RPC.UDPSpec (spec, trackerURIs) where |
3 | 3 | ||
4 | import Control.Monad | 4 | import Control.Monad |
5 | import Data.Default | 5 | import Data.Default |