diff options
Diffstat (limited to 'tests/Network/BitTorrent/Exchange/BlockSpec.hs')
-rw-r--r-- | tests/Network/BitTorrent/Exchange/BlockSpec.hs | 9 |
1 files changed, 8 insertions, 1 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 |