diff options
Diffstat (limited to 'tests/Network/BitTorrent')
-rw-r--r-- | tests/Network/BitTorrent/DHT/MessageSpec.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/Network/BitTorrent/DHT/MessageSpec.hs b/tests/Network/BitTorrent/DHT/MessageSpec.hs index 0d84c919..4ec875dd 100644 --- a/tests/Network/BitTorrent/DHT/MessageSpec.hs +++ b/tests/Network/BitTorrent/DHT/MessageSpec.hs | |||
@@ -7,6 +7,7 @@ import Data.BEncode as BE | |||
7 | import Data.ByteString.Lazy as BL | 7 | import Data.ByteString.Lazy as BL |
8 | import Data.Default | 8 | import Data.Default |
9 | import Data.List as L | 9 | import Data.List as L |
10 | import Data.Maybe | ||
10 | import Network.BitTorrent.Core | 11 | import Network.BitTorrent.Core |
11 | import Network.BitTorrent.DHT.Message | 12 | import Network.BitTorrent.DHT.Message |
12 | import qualified Network.KRPC as KRPC (def) | 13 | import qualified Network.KRPC as KRPC (def) |
@@ -57,12 +58,13 @@ spec :: Spec | |||
57 | spec = do | 58 | spec = do |
58 | context ("you need running DHT node at " ++ show remoteAddr) $ do | 59 | context ("you need running DHT node at " ++ show remoteAddr) $ do |
59 | it "is running" $ do | 60 | it "is running" $ do |
60 | _ <- retry 5 $ timeout (100 * 1000) $ do | 61 | running <- retry 5 $ timeout (100 * 1000) $ do |
61 | nid <- genNodeId | 62 | nid <- genNodeId |
62 | Response _remoteAddr Ping <- | 63 | Response _remoteAddr Ping <- |
63 | rpc (query remoteAddr (Query nid Ping)) | 64 | rpc (query remoteAddr (Query nid Ping)) |
64 | return () | 65 | return () |
65 | return () | 66 | running `shouldSatisfy` isJust |
67 | |||
66 | describe "ping" $ do | 68 | describe "ping" $ do |
67 | it "properly bencoded" $ do | 69 | it "properly bencoded" $ do |
68 | BE.decode "d2:id20:abcdefghij0123456789e" | 70 | BE.decode "d2:id20:abcdefghij0123456789e" |