summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/Exchange/BlockSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Network/BitTorrent/Exchange/BlockSpec.hs')
-rw-r--r--tests/Network/BitTorrent/Exchange/BlockSpec.hs9
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 @@
1module Network.BitTorrent.Exchange.BlockSpec (spec) where 1module Network.BitTorrent.Exchange.BlockSpec (spec) where
2import Control.Applicative 2import Control.Applicative
3import Data.Maybe
3import Test.Hspec 4import Test.Hspec
4import Test.QuickCheck 5import Test.QuickCheck
5 6
@@ -12,8 +13,14 @@ instance Arbitrary a => Arbitrary (Block a) where
12instance Arbitrary BlockIx where 13instance Arbitrary BlockIx where
13 arbitrary = BlockIx <$> arbitrary <*> arbitrary <*> arbitrary 14 arbitrary = BlockIx <$> arbitrary <*> arbitrary <*> arbitrary
14 15
16instance Arbitrary Bucket where
17 arbitrary = error "arbitrary: block bucket"
18
19instance Show Bucket where
20 show = error "show: bucket"
21
15spec :: Spec 22spec :: Spec
16spec = do 23spec = 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