diff options
Diffstat (limited to 'tests/info-hash.hs')
-rw-r--r-- | tests/info-hash.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/info-hash.hs b/tests/info-hash.hs index 07c01c9c..1638a205 100644 --- a/tests/info-hash.hs +++ b/tests/info-hash.hs | |||
@@ -1,23 +1,20 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | 1 | {-# LANGUAGE OverloadedStrings #-} |
2 | module Main (main) where | 2 | module Main (main) where |
3 | 3 | ||
4 | import Data.Foldable | ||
5 | import Data.ByteString (ByteString) | 4 | import Data.ByteString (ByteString) |
6 | import qualified Data.ByteString as B | 5 | import qualified Data.ByteString as B |
7 | import qualified Data.ByteString.Char8 as BC | 6 | import qualified Data.ByteString.Char8 as BC |
8 | import qualified Data.ByteString.Lazy as L | 7 | import qualified Data.ByteString.Lazy as L |
9 | import qualified Data.ByteString.Builder as B | 8 | |
10 | import qualified Data.ByteString.Builder.Prim as B | ||
11 | import Data.Torrent | 9 | import Data.Torrent |
10 | import Data.Torrent.InfoHash | ||
11 | |||
12 | import System.Environment | 12 | import System.Environment |
13 | import System.Exit | 13 | import System.Exit |
14 | 14 | ||
15 | checkInfo :: ByteString | 15 | checkInfo :: ByteString |
16 | checkInfo = "0221caf96aa3cb94f0f58d458e78b0fc344ad8bf" | 16 | checkInfo = "0221caf96aa3cb94f0f58d458e78b0fc344ad8bf" |
17 | 17 | ||
18 | ppHex :: B.ByteString -> B.ByteString | ||
19 | ppHex = L.toStrict . B.toLazyByteString . foldMap (B.primFixed B.word8HexFixed) . B.unpack | ||
20 | |||
21 | torrentFileName :: String | 18 | torrentFileName :: String |
22 | torrentFileName = "tests/dapper-dvd-amd64.iso.torrent" | 19 | torrentFileName = "tests/dapper-dvd-amd64.iso.torrent" |
23 | 20 | ||