diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Network/BitTorrent/Tracker/CacheSpec.hs | 7 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Tracker/SessionSpec.hs | 25 |
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 @@ | |||
1 | module Network.BitTorrent.Tracker.CacheSpec (spec) where | ||
2 | import Test.Hspec | ||
3 | |||
4 | spec :: Spec | ||
5 | spec = 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 @@ | |||
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 | ||