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
creationDate = Just 1428717851,
comment = Just "hello world",
createdBy = Just "Jaseem Abid",
- encoding = Just "UTF-8"
+ encoding = Just "UTF-8",
+ infoHash = "\205CX(;\163<?TWS\175\CAND\222\253\250\214\136\EOT"
}
testFile :: TestTree
testResponse2]
tests :: TestTree
-tests = testGroup "Tests" [unitTests]
+tests = testGroup "Tests" [unitTests, BencodeTests.tests]
main :: IO ()
main = defaultMain tests