import qualified MagneturiTests as Muri
import qualified BencodeTests as Benc
+import qualified MetainfoTests as Minfo
main :: IO ()
main = do
Muri.tests
+ Minfo.tests
Benc.tests
--- /dev/null
+-- | Tests for Metainfo module
+
+module MetainfoTests where
+
+import Prelude hiding (readFile)
+
+import FuncTorrent.Metainfo
+import Test.Hspec
+import Data.ByteString (readFile)
+
+tests :: IO ()
+tests = hspec $ do
+ describe "read and interpret a torrent file 1" $ do
+ it "valid announceList" $ do
+ fc <- readFile "data/debian-7.8.0-amd64-CD-1.iso.torrent"
+ (torrentToMetainfo fc) `shouldNotBe` (Left "parse error")
+