summaryrefslogtreecommitdiff
path: root/tests/info-hash.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/info-hash.hs')
-rw-r--r--tests/info-hash.hs9
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 #-}
2module Main (main) where 2module Main (main) where
3 3
4import Data.Foldable
5import Data.ByteString (ByteString) 4import Data.ByteString (ByteString)
6import qualified Data.ByteString as B 5import qualified Data.ByteString as B
7import qualified Data.ByteString.Char8 as BC 6import qualified Data.ByteString.Char8 as BC
8import qualified Data.ByteString.Lazy as L 7import qualified Data.ByteString.Lazy as L
9import qualified Data.ByteString.Builder as B 8
10import qualified Data.ByteString.Builder.Prim as B
11import Data.Torrent 9import Data.Torrent
10import Data.Torrent.InfoHash
11
12import System.Environment 12import System.Environment
13import System.Exit 13import System.Exit
14 14
15checkInfo :: ByteString 15checkInfo :: ByteString
16checkInfo = "0221caf96aa3cb94f0f58d458e78b0fc344ad8bf" 16checkInfo = "0221caf96aa3cb94f0f58d458e78b0fc344ad8bf"
17 17
18ppHex :: B.ByteString -> B.ByteString
19ppHex = L.toStrict . B.toLazyByteString . foldMap (B.primFixed B.word8HexFixed) . B.unpack
20
21torrentFileName :: String 18torrentFileName :: String
22torrentFileName = "tests/dapper-dvd-amd64.iso.torrent" 19torrentFileName = "tests/dapper-dvd-amd64.iso.torrent"
23 20