summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-11-30 13:30:19 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-11-30 13:30:19 +0400
commit915dab01a9aefd59497ea97e76b45db3a865635f (patch)
tree502f003d19dc8bb025827e7f8fbe050e045af702 /tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs
parent5573c240b4c2e87cf2deb55939591edd0851f8b8 (diff)
Rename scrape datatypes
Diffstat (limited to 'tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs')
-rw-r--r--tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs
index 1a893011..73cf07f3 100644
--- a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs
+++ b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs
@@ -11,7 +11,7 @@ import Test.Hspec
11import Test.QuickCheck 11import Test.QuickCheck
12 12
13import Network.BitTorrent.Core.PeerAddr 13import Network.BitTorrent.Core.PeerAddr
14import Network.BitTorrent.Tracker.RPC.Message 14import Network.BitTorrent.Tracker.RPC.Message as Message
15import Network.BitTorrent.Tracker.RPC.UDP 15import Network.BitTorrent.Tracker.RPC.UDP
16import Network.BitTorrent.Tracker.RPC.MessageSpec () 16import Network.BitTorrent.Tracker.RPC.MessageSpec ()
17 17
@@ -27,6 +27,7 @@ trackerURIs =
27 27
28-- relation with query: peer id, numwant 28-- relation with query: peer id, numwant
29validateInfo :: AnnounceQuery -> AnnounceInfo -> Expectation 29validateInfo :: AnnounceQuery -> AnnounceInfo -> Expectation
30validateInfo _ Message.Failure {..} = error "validateInfo: failure"
30validateInfo AnnounceQuery {..} AnnounceInfo {..} = do 31validateInfo AnnounceQuery {..} AnnounceInfo {..} = do
31 respComplete `shouldSatisfy` isJust 32 respComplete `shouldSatisfy` isJust
32 respIncomplete `shouldSatisfy` isJust 33 respIncomplete `shouldSatisfy` isJust
@@ -44,11 +45,10 @@ spec = do
44 context (show uri) $ do 45 context (show uri) $ do
45 describe "announce" $ do 46 describe "announce" $ do
46 it "have valid response" $ do 47 it "have valid response" $ do
47 query <- arbitrarySample 48 q <- arbitrarySample
48 connect uri >>= announce query >>= validateInfo query 49 connect uri >>= announce q >>= validateInfo q
49 50
50 describe "scrape" $ do 51 describe "scrape" $ do
51 it "have valid response" $ do 52 it "have valid response" $ do
52 xs <- connect uri >>= scrape [def] 53 xs <- connect uri >>= scrape [def]
53 return () 54 L.length xs `shouldSatisfy` (>= 1)
54-- L.length xs `shouldSatisfy` (>= 1)