summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/Tracker/TestData.hs
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-26 15:33:05 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-26 15:33:05 +0400
commiteb54b4d99fa8683084ced2e8b16ae18b819a35df (patch)
tree750c77d78fdf06320f93e68c506dc4e436daaaf2 /tests/Network/BitTorrent/Tracker/TestData.hs
parenta92c7e63331614afba13e0d8e43791e0f440f2fc (diff)
Use TestData in tracker spec
Diffstat (limited to 'tests/Network/BitTorrent/Tracker/TestData.hs')
-rw-r--r--tests/Network/BitTorrent/Tracker/TestData.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/Network/BitTorrent/Tracker/TestData.hs b/tests/Network/BitTorrent/Tracker/TestData.hs
index 5d9718e5..85544b91 100644
--- a/tests/Network/BitTorrent/Tracker/TestData.hs
+++ b/tests/Network/BitTorrent/Tracker/TestData.hs
@@ -1,6 +1,9 @@
1{-# LANGUAGE RecordWildCards #-}
1{-# OPTIONS_GHC -fno-warn-orphans #-} 2{-# OPTIONS_GHC -fno-warn-orphans #-}
2module Network.BitTorrent.Tracker.TestData 3module Network.BitTorrent.Tracker.TestData
3 ( TrackerEntry (..) 4 ( TrackerEntry (..)
5 , isUdpTracker
6 , isHttpTracker
4 , trackers 7 , trackers
5 ) where 8 ) where
6 9
@@ -29,6 +32,13 @@ data TrackerEntry = TrackerEntry
29 , hashList :: Maybe [InfoHash] 32 , hashList :: Maybe [InfoHash]
30 } 33 }
31 34
35isUdpTracker :: TrackerEntry -> Bool
36isUdpTracker TrackerEntry {..} = uriScheme trackerURI == "udp:"
37
38isHttpTracker :: TrackerEntry -> Bool
39isHttpTracker TrackerEntry {..} = uriScheme trackerURI == "http:"
40 || uriScheme trackerURI == "https:"
41
32instance IsString URI where 42instance IsString URI where
33 fromString str = fromMaybe err $ parseURI str 43 fromString str = fromMaybe err $ parseURI str
34 where 44 where