summaryrefslogtreecommitdiff
path: root/tests/Network
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Network')
-rw-r--r--tests/Network/BitTorrent/Tracker/RPCSpec.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/Network/BitTorrent/Tracker/RPCSpec.hs b/tests/Network/BitTorrent/Tracker/RPCSpec.hs
index b816a9ce..dfc13a1e 100644
--- a/tests/Network/BitTorrent/Tracker/RPCSpec.hs
+++ b/tests/Network/BitTorrent/Tracker/RPCSpec.hs
@@ -24,9 +24,9 @@ rpcOpts = def
24 { optUdpRPC = UDP.rpcOpts 24 { optUdpRPC = UDP.rpcOpts
25 } 25 }
26 26
27isUnrecognizedProtocol :: String -> RpcException -> Bool 27matchUnrecognizedScheme :: String -> RpcException -> Bool
28isUnrecognizedProtocol x (UnrecognizedProtocol scheme) = x == scheme 28matchUnrecognizedScheme x (UnrecognizedScheme scheme) = x == scheme
29isUnrecognizedProtocol _ _ = False 29matchUnrecognizedScheme _ _ = False
30 30
31spec :: Spec 31spec :: Spec
32spec = parallel $ do 32spec = parallel $ do
@@ -46,13 +46,13 @@ spec = parallel $ do
46 withManager rpcOpts def $ \ mgr -> do 46 withManager rpcOpts def $ \ mgr -> do
47 q <- arbitrarySample 47 q <- arbitrarySample
48 announce mgr "magnet://foo.bar" q 48 announce mgr "magnet://foo.bar" q
49 `shouldThrow` isUnrecognizedProtocol "magnet:" 49 `shouldThrow` matchUnrecognizedScheme "magnet:"
50 50
51 describe "scrape" $ do 51 describe "scrape" $ do
52 it "must fail on bad uri scheme" $ do 52 it "must fail on bad uri scheme" $ do
53 withManager rpcOpts def $ \ mgr -> do 53 withManager rpcOpts def $ \ mgr -> do
54 scrape mgr "magnet://foo.bar" [] 54 scrape mgr "magnet://foo.bar" []
55 `shouldThrow` isUnrecognizedProtocol "magnet:" 55 `shouldThrow` matchUnrecognizedScheme "magnet:"
56 56
57 forM_ trackers $ \ TrackerEntry {..} -> 57 forM_ trackers $ \ TrackerEntry {..} ->
58 context trackerName $ do 58 context trackerName $ do