diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2014-02-26 16:10:18 +0100 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2014-02-26 16:10:18 +0100 |
commit | 6146b69ecc0f47b1b09e0a3edfa92cb2eda61963 (patch) | |
tree | 686e6308f45146b5547228e3f4def851462feadd /tests/Network/BitTorrent/DHT/MessageSpec.hs | |
parent | b041624dca8b66d89180158e28bc5d0808046023 (diff) | |
parent | 80d9b5f02c5b245717651132482f11ac66a7ef4a (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.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" |