summaryrefslogtreecommitdiff
path: root/tests/Network
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
parentb3ebd83bda11e5fbf8e749fe4105e7a50522a9a7 (diff)
Expose tracker RPC module
Diffstat (limited to 'tests/Network')
-rw-r--r--tests/Network/BitTorrent/Exchange/BlockSpec.hs9
-rw-r--r--tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs2
-rw-r--r--tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs2
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 @@
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
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 @@
1module Network.BitTorrent.Tracker.RPC.HTTPSpec (spec) where 1module Network.BitTorrent.Tracker.RPC.HTTPSpec (spec, trackerURIs) where
2 2
3import Control.Monad 3import Control.Monad
4import Control.Monad.Trans 4import 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 #-}
2module Network.BitTorrent.Tracker.RPC.UDPSpec (spec) where 2module Network.BitTorrent.Tracker.RPC.UDPSpec (spec, trackerURIs) where
3 3
4import Control.Monad 4import Control.Monad
5import Data.Default 5import Data.Default