diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-04 02:09:45 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-04 02:09:45 +0400 |
commit | 6906ff501b31ea0328c6db4038ada43e53a7d46b (patch) | |
tree | 45a2f471f84abce6b5561da7e4ad16dbb2e4cc23 /tests/InfoHash.hs | |
parent | b86c21c92187008a692ad6ee8b33b4edd50447d3 (diff) |
~ Move info hash test to main test suite.
Diffstat (limited to 'tests/InfoHash.hs')
-rw-r--r-- | tests/InfoHash.hs | 29 |
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 #-} | ||
2 | module Main (main) where | ||
3 | |||
4 | import qualified Data.ByteString.Char8 as BC | ||
5 | import Data.Torrent | ||
6 | |||
7 | import System.Environment | ||
8 | import System.Exit | ||
9 | |||
10 | checkInfo :: String | ||
11 | checkInfo = "0221caf96aa3cb94f0f58d458e78b0fc344ad8bf" | ||
12 | |||
13 | torrentFileName :: String | ||
14 | torrentFileName = "res/dapper-dvd-amd64.iso.torrent" | ||
15 | |||
16 | main :: IO () | ||
17 | main = 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 | ||