diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-30 13:30:19 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-30 13:30:19 +0400 |
commit | 915dab01a9aefd59497ea97e76b45db3a865635f (patch) | |
tree | 502f003d19dc8bb025827e7f8fbe050e045af702 /tests/Network/BitTorrent/Tracker/RPC | |
parent | 5573c240b4c2e87cf2deb55939591edd0851f8b8 (diff) |
Rename scrape datatypes
Diffstat (limited to 'tests/Network/BitTorrent/Tracker/RPC')
-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) | ||