summaryrefslogtreecommitdiff
path: root/tests/InfoHash.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/InfoHash.hs')
-rw-r--r--tests/InfoHash.hs29
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/InfoHash.hs b/tests/InfoHash.hs
deleted file mode 100644
index bbf77545..00000000
--- a/tests/InfoHash.hs
+++ /dev/null
@@ -1,29 +0,0 @@
1{-# LANGUAGE OverloadedStrings #-}
2module Main (main) where
3
4import qualified Data.ByteString.Char8 as BC
5import Data.Torrent
6
7import System.Environment
8import System.Exit
9
10checkInfo :: String
11checkInfo = "0221caf96aa3cb94f0f58d458e78b0fc344ad8bf"
12
13torrentFileName :: String
14torrentFileName = "res/dapper-dvd-amd64.iso.torrent"
15
16main :: IO ()
17main = do
18 args <- getArgs
19 let path = if length args == 0 then torrentFileName else head args
20
21 t <- fromFile path
22
23 BC.putStr "info hash: "
24 print (ppInfoHash (tInfoHash t))
25
26 let passed = checkInfo == show (ppInfoHash (tInfoHash t))
27
28 print passed
29 if passed then exitSuccess else exitFailure