summaryrefslogtreecommitdiff
path: root/tests/Network/BitTorrent/Tracker/TestData.hs
diff options
context:
space:
mode:
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