diff options
Diffstat (limited to 'tests/Network/BitTorrent/DHT/SessionSpec.hs')
-rw-r--r-- | tests/Network/BitTorrent/DHT/SessionSpec.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/Network/BitTorrent/DHT/SessionSpec.hs b/tests/Network/BitTorrent/DHT/SessionSpec.hs index b3b9a9fc..bb32cf0e 100644 --- a/tests/Network/BitTorrent/DHT/SessionSpec.hs +++ b/tests/Network/BitTorrent/DHT/SessionSpec.hs | |||
@@ -2,6 +2,7 @@ | |||
2 | module Network.BitTorrent.DHT.SessionSpec (spec) where | 2 | module Network.BitTorrent.DHT.SessionSpec (spec) where |
3 | import Control.Applicative | 3 | import Control.Applicative |
4 | import Control.Concurrent | 4 | import Control.Concurrent |
5 | import Control.Exception | ||
5 | import Control.Monad.Reader | 6 | import Control.Monad.Reader |
6 | import Control.Monad.Trans.Resource | 7 | import Control.Monad.Trans.Resource |
7 | import Data.Default | 8 | import Data.Default |
@@ -23,7 +24,9 @@ myAddr :: NodeAddr IPv4 | |||
23 | myAddr = "127.0.0.1:60000" | 24 | myAddr = "127.0.0.1:60000" |
24 | 25 | ||
25 | simpleDHT :: DHT IPv4 a -> IO a | 26 | simpleDHT :: DHT IPv4 a -> IO a |
26 | simpleDHT = dht def myAddr | 27 | simpleDHT m = |
28 | bracket (newNode defaultHandlers def myAddr nullLogger) closeNode $ \ node -> | ||
29 | runDHT node m | ||
27 | 30 | ||
28 | isRight :: Either a b -> Bool | 31 | isRight :: Either a b -> Bool |
29 | isRight (Left _) = False | 32 | isRight (Left _) = False |