summaryrefslogtreecommitdiff
path: root/tests/Network
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2015-04-01 15:39:38 -0400
committerjoe <joe@jerkface.net>2015-04-01 15:39:38 -0400
commitcaba20a08600d92d43b57abb51850341ade89dfb (patch)
tree3fcae0b405d91d6b695a6da63bad3c1096018fdc /tests/Network
parent1c73ec7dff361ea3ea4d2b8f641de93412668f5b (diff)
newNode now accepts optional NodeId to use.
Diffstat (limited to 'tests/Network')
-rw-r--r--tests/Network/BitTorrent/DHT/QuerySpec.hs4
-rw-r--r--tests/Network/BitTorrent/DHT/SessionSpec.hs6
2 files changed, 5 insertions, 5 deletions
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 ()
28 28
29simpleDHT :: [NodeHandler IPv4] -> DHT IPv4 a -> IO a 29simpleDHT :: [NodeHandler IPv4] -> DHT IPv4 a -> IO a
30simpleDHT hs m = 30simpleDHT hs m =
31 bracket (newNode hs def myAddr nullLogger) closeNode $ \ node -> 31 bracket (newNode hs def myAddr nullLogger Nothing) closeNode $ \ node ->
32 runDHT node m 32 runDHT node m
33 33
34getBootInfo :: IO (NodeInfo IPv4) 34getBootInfo :: IO (NodeInfo IPv4)
@@ -102,4 +102,4 @@ spec = parallel $ do
102 sourceList [startNodes] $= 102 sourceList [startNodes] $=
103 search entryHash (getPeersQ entryHash) $= 103 search entryHash (getPeersQ entryHash) $=
104 CL.concat $$ CL.take 10 104 CL.concat $$ CL.take 10
105 L.length peers `shouldBe` 10 \ No newline at end of file 105 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"
26 26
27simpleDHT :: DHT IPv4 a -> IO a 27simpleDHT :: DHT IPv4 a -> IO a
28simpleDHT m = 28simpleDHT m =
29 bracket (newNode defaultHandlers def myAddr nullLogger) closeNode $ \ node -> 29 bracket (newNode defaultHandlers def myAddr nullLogger Nothing) closeNode $ \ node ->
30 runDHT node m 30 runDHT node m
31 31
32isRight :: Either a b -> Bool 32isRight :: Either a b -> Bool
@@ -43,7 +43,7 @@ spec :: Spec
43spec = do 43spec = do
44 describe "session" $ do 44 describe "session" $ do
45 it "is active until closeNode called" $ do 45 it "is active until closeNode called" $ do
46 node <- newNode [] def myAddr nullLogger 46 node <- newNode [] def myAddr nullLogger Nothing
47 runDHT node monadActive `shouldReturn` True 47 runDHT node monadActive `shouldReturn` True
48 runDHT node monadActive `shouldReturn` True 48 runDHT node monadActive `shouldReturn` True
49 closeNode node 49 closeNode node
@@ -106,4 +106,4 @@ spec = do
106 106
107 describe "(<@>) operator" $ do 107 describe "(<@>) operator" $ do
108 it "" $ 108 it "" $
109 pending \ No newline at end of file 109 pending