summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/DHT/MessageSpec.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2014-02-26 16:10:18 +0100
committerDaniel Gröber <dxld@darkboxed.org>2014-02-26 16:10:18 +0100
commit6146b69ecc0f47b1b09e0a3edfa92cb2eda61963 (patch)
tree686e6308f45146b5547228e3f4def851462feadd /tests/Network/BitTorrent/DHT/MessageSpec.hs
parentb041624dca8b66d89180158e28bc5d0808046023 (diff)
parent80d9b5f02c5b245717651132482f11ac66a7ef4a (diff)
Merge branch 'master' of https://github.com/cobit/bittorrent
Diffstat (limited to 'tests/Network/BitTorrent/DHT/MessageSpec.hs')
-rw-r--r--tests/Network/BitTorrent/DHT/MessageSpec.hs6
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
7import Data.ByteString.Lazy as BL 7import Data.ByteString.Lazy as BL
8import Data.Default 8import Data.Default
9import Data.List as L 9import Data.List as L
10import Data.Maybe
10import Network.BitTorrent.Core 11import Network.BitTorrent.Core
11import Network.BitTorrent.DHT.Message 12import Network.BitTorrent.DHT.Message
12import qualified Network.KRPC as KRPC (def) 13import qualified Network.KRPC as KRPC (def)
@@ -57,12 +58,13 @@ spec :: Spec
57spec = do 58spec = 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"