summaryrefslogtreecommitdiff
path: root/tests/InfoHash.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-04 02:09:45 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-04 02:09:45 +0400
commit6906ff501b31ea0328c6db4038ada43e53a7d46b (patch)
tree45a2f471f84abce6b5561da7e4ad16dbb2e4cc23 /tests/InfoHash.hs
parentb86c21c92187008a692ad6ee8b33b4edd50447d3 (diff)
~ Move info hash test to main test suite.
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