diff options
Diffstat (limited to 'tests/Network/BitTorrent/Tracker/SessionSpec.hs')
-rw-r--r-- | tests/Network/BitTorrent/Tracker/SessionSpec.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/Network/BitTorrent/Tracker/SessionSpec.hs b/tests/Network/BitTorrent/Tracker/SessionSpec.hs new file mode 100644 index 00000000..0c75fcaa --- /dev/null +++ b/tests/Network/BitTorrent/Tracker/SessionSpec.hs | |||
@@ -0,0 +1,25 @@ | |||
1 | module Network.BitTorrent.Tracker.SessionSpec (spec) where | ||
2 | import Data.Default | ||
3 | import Data.List as L | ||
4 | import Network.URI | ||
5 | import Test.Hspec | ||
6 | |||
7 | import Data.Torrent | ||
8 | import Network.BitTorrent.Tracker.List | ||
9 | import Network.BitTorrent.Tracker.RPC.UDPSpec (trackerURIs) | ||
10 | import Network.BitTorrent.Tracker.RPC | ||
11 | import Network.BitTorrent.Tracker.Session | ||
12 | |||
13 | |||
14 | trackers :: TrackerList URI | ||
15 | trackers = trackerList def { tAnnounceList = Just [trackerURIs] } | ||
16 | |||
17 | spec :: Spec | ||
18 | spec = do | ||
19 | describe "Session" $ do | ||
20 | it "" $ do | ||
21 | withManager def def $ \ m -> do | ||
22 | s <- newSession def trackers | ||
23 | notify m s Started | ||
24 | peers <- askPeers m s | ||
25 | peers `shouldSatisfy` (not . L.null) \ No newline at end of file | ||