summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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