From caba20a08600d92d43b57abb51850341ade89dfb Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 1 Apr 2015 15:39:38 -0400 Subject: newNode now accepts optional NodeId to use. --- tests/Network/BitTorrent/DHT/QuerySpec.hs | 4 ++-- tests/Network/BitTorrent/DHT/SessionSpec.hs | 6 +++--- 2 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 81c3b45b..6b3b5485 100644 --- a/tests/Network/BitTorrent/DHT/QuerySpec.hs +++ b/tests/Network/BitTorrent/DHT/QuerySpec.hs @@ -28,7 +28,7 @@ nullLogger _ _ _ _ = return () simpleDHT :: [NodeHandler IPv4] -> DHT IPv4 a -> IO a simpleDHT hs m = - bracket (newNode hs def myAddr nullLogger) closeNode $ \ node -> + bracket (newNode hs def myAddr nullLogger Nothing) closeNode $ \ node -> runDHT node m getBootInfo :: IO (NodeInfo IPv4) @@ -102,4 +102,4 @@ spec = parallel $ do sourceList [startNodes] $= search entryHash (getPeersQ entryHash) $= CL.concat $$ CL.take 10 - L.length peers `shouldBe` 10 \ No newline at end of file + L.length peers `shouldBe` 10 diff --git a/tests/Network/BitTorrent/DHT/SessionSpec.hs b/tests/Network/BitTorrent/DHT/SessionSpec.hs index 8c536352..ef844b31 100644 --- a/tests/Network/BitTorrent/DHT/SessionSpec.hs +++ b/tests/Network/BitTorrent/DHT/SessionSpec.hs @@ -26,7 +26,7 @@ myAddr = "127.0.0.1:60000" simpleDHT :: DHT IPv4 a -> IO a simpleDHT m = - bracket (newNode defaultHandlers def myAddr nullLogger) closeNode $ \ node -> + bracket (newNode defaultHandlers def myAddr nullLogger Nothing) closeNode $ \ node -> runDHT node m isRight :: Either a b -> Bool @@ -43,7 +43,7 @@ spec :: Spec spec = do describe "session" $ do it "is active until closeNode called" $ do - node <- newNode [] def myAddr nullLogger + node <- newNode [] def myAddr nullLogger Nothing runDHT node monadActive `shouldReturn` True runDHT node monadActive `shouldReturn` True closeNode node @@ -106,4 +106,4 @@ spec = do describe "(<@>) operator" $ do it "" $ - pending \ No newline at end of file + pending -- cgit v1.2.3