summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/Exchange/BlockSpec.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-12-13 08:24:58 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-12-13 08:24:58 +0400
commit08eeeaa520b08858af9efafe8ad921dc6e7a46e1 (patch)
treec75815fd8cdffc7d45eb3720c138c51bb0915916 /tests/Network/BitTorrent/Exchange/BlockSpec.hs
parentb3ebd83bda11e5fbf8e749fe4105e7a50522a9a7 (diff)
Expose tracker RPC module
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