X-Git-Url: https://git.rkrishnan.org/?a=blobdiff_plain;f=test%2FTest.hs;h=71b9f1c6ef5c0991c2a507387c29555f27349fc9;hb=27fccae52521d6b0d0502708d737c3b6eb908941;hp=3ead970aa024b32d8e2ba3473b2ca474041c1ebf;hpb=710a9e752a81e9a377c5fb7943609825f4d40fb2;p=functorrent.git diff --git a/test/Test.hs b/test/Test.hs index 3ead970..71b9f1c 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -2,16 +2,19 @@ module Main where import Prelude hiding (readFile) -import Data.ByteString.Char8 (ByteString, readFile) + +import Data.ByteString (ByteString, readFile) import Data.Map.Strict (fromList) -import Test.Tasty -import Test.Tasty.HUnit +import Test.Tasty (TestTree, testGroup, defaultMain) +import Test.Tasty.HUnit (testCase, (@?=)) -import FuncTorrent.Bencode (decode, BVal(..)) +import FuncTorrent.Bencode (encode, decode, BVal(..)) import FuncTorrent.Metainfo (Info(..), Metainfo(..), mkMetaInfo) import FuncTorrent.Peer (Peer(..)) -import FuncTorrent.Tracker (TrackerResponse(..), peers, mkTrackerResponse) +import FuncTorrent.Tracker + +import qualified BencodeTests -- Parsed .torrent file file :: BVal @@ -42,7 +45,8 @@ hello = Metainfo { creationDate = Just 1428717851, comment = Just "hello world", createdBy = Just "Jaseem Abid", - encoding = Just "UTF-8" + encoding = Just "UTF-8", + infoHash = "\205CX(;\163