From 3c7f12c10caca196a970c0cc8b6c46945c9dee58 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Wed, 5 Mar 2014 00:35:47 +0400 Subject: Minor refactoring --- tests/Network/BitTorrent/DHT/QuerySpec.hs | 4 ++-- tests/Network/BitTorrent/DHT/RoutingSpec.hs | 2 +- tests/Network/BitTorrent/Exchange/SessionSpec.hs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/Network') diff --git a/tests/Network/BitTorrent/DHT/QuerySpec.hs b/tests/Network/BitTorrent/DHT/QuerySpec.hs index 33114b40..d25bd120 100644 --- a/tests/Network/BitTorrent/DHT/QuerySpec.hs +++ b/tests/Network/BitTorrent/DHT/QuerySpec.hs @@ -18,7 +18,7 @@ import Network.BitTorrent.DHT.TestData myAddr :: NodeAddr IPv4 -myAddr = "0.0.0.0:8000" +myAddr = "0.0.0.0:0" nullLogger :: LogFun nullLogger _ _ _ _ = return () @@ -37,7 +37,7 @@ getBootInfo = do simpleDHT [] $ pingQ startAddr spec :: Spec -spec = do +spec = parallel $ do describe "environment" $ do describe "test node" $ do it "is alive" $ do diff --git a/tests/Network/BitTorrent/DHT/RoutingSpec.hs b/tests/Network/BitTorrent/DHT/RoutingSpec.hs index 788c4341..c4a33357 100644 --- a/tests/Network/BitTorrent/DHT/RoutingSpec.hs +++ b/tests/Network/BitTorrent/DHT/RoutingSpec.hs @@ -27,7 +27,7 @@ runSimulation :: Eq ip => Env ip -> Routing ip a -> Maybe a runSimulation e m = evalState (runRouting ping closest timestamp m) e where ping addr = gets (L.elem addr . network) - closest nid = undefined + closest nid = error "runSimulation" timestamp = gets currentTime instance Arbitrary ip => Arbitrary (Env ip) where diff --git a/tests/Network/BitTorrent/Exchange/SessionSpec.hs b/tests/Network/BitTorrent/Exchange/SessionSpec.hs index 745649fe..f80fc864 100644 --- a/tests/Network/BitTorrent/Exchange/SessionSpec.hs +++ b/tests/Network/BitTorrent/Exchange/SessionSpec.hs @@ -4,7 +4,7 @@ import Test.Hspec import Data.Torrent import Network.BitTorrent.Core -import Network.BitTorrent.Exchange.Session as S +import Network.BitTorrent.Exchange.Session import Config @@ -20,7 +20,7 @@ spec = do Torrent {..} <- getTestTorrent myAddr <- getMyAddr ses <- newSession nullLogger myAddr "" tInfoDict - S.insert addr ses + connect addr ses dict <- waitMetadata ses closeSession ses dict `shouldBe` tInfoDict -- cgit v1.2.3