summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/Tracker
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-08 07:19:31 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-08 07:19:31 +0400
commit7edacaaedd432c71169bbd59c9c0948e9a83da26 (patch)
tree1ca88d119c3575c502e184bfcc15572ee6a406f9 /tests/Network/BitTorrent/Tracker
parentf1f28f1a128caa3df5cdab2eb4c22ec07633af06 (diff)
Add multitracker session
Diffstat (limited to 'tests/Network/BitTorrent/Tracker')
-rw-r--r--tests/Network/BitTorrent/Tracker/CacheSpec.hs7
-rw-r--r--tests/Network/BitTorrent/Tracker/SessionSpec.hs25
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/Network/BitTorrent/Tracker/CacheSpec.hs b/tests/Network/BitTorrent/Tracker/CacheSpec.hs
new file mode 100644
index 00000000..db015957
--- /dev/null
+++ b/tests/Network/BitTorrent/Tracker/CacheSpec.hs
@@ -0,0 +1,7 @@
1module Network.BitTorrent.Tracker.CacheSpec (spec) where
2import Test.Hspec
3
4spec :: Spec
5spec = do
6 describe "Cached" $ do
7 return ()
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 @@
1module Network.BitTorrent.Tracker.SessionSpec (spec) where
2import Data.Default
3import Data.List as L
4import Network.URI
5import Test.Hspec
6
7import Data.Torrent
8import Network.BitTorrent.Tracker.List
9import Network.BitTorrent.Tracker.RPC.UDPSpec (trackerURIs)
10import Network.BitTorrent.Tracker.RPC
11import Network.BitTorrent.Tracker.Session
12
13
14trackers :: TrackerList URI
15trackers = trackerList def { tAnnounceList = Just [trackerURIs] }
16
17spec :: Spec
18spec = 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