diff options
Diffstat (limited to 'tests/Network/BitTorrent/Tracker')
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | 10 |
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 | |||
11 | import Test.QuickCheck | 11 | import Test.QuickCheck |
12 | 12 | ||
13 | import Network.BitTorrent.Core.PeerAddr | 13 | import Network.BitTorrent.Core.PeerAddr |
14 | import Network.BitTorrent.Tracker.RPC.Message | 14 | import Network.BitTorrent.Tracker.RPC.Message as Message |
15 | import Network.BitTorrent.Tracker.RPC.UDP | 15 | import Network.BitTorrent.Tracker.RPC.UDP |
16 | import Network.BitTorrent.Tracker.RPC.MessageSpec () | 16 | import 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 |
29 | validateInfo :: AnnounceQuery -> AnnounceInfo -> Expectation | 29 | validateInfo :: AnnounceQuery -> AnnounceInfo -> Expectation |
30 | validateInfo _ Message.Failure {..} = error "validateInfo: failure" | ||
30 | validateInfo AnnounceQuery {..} AnnounceInfo {..} = do | 31 | validateInfo 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) | ||