X-Git-Url: https://git.rkrishnan.org/?p=functorrent.git;a=blobdiff_plain;f=test%2FMetainfoTests.hs;fp=test%2FMetainfoTests.hs;h=86ecf482e16c7079886896b631d90d9a29dfe503;hp=0000000000000000000000000000000000000000;hb=1001ed08048be077081aa6829186e0b35bd69193;hpb=972e7a451abd851317146c196bc675fd11751fc8 diff --git a/test/MetainfoTests.hs b/test/MetainfoTests.hs new file mode 100644 index 0000000..86ecf48 --- /dev/null +++ b/test/MetainfoTests.hs @@ -0,0 +1,17 @@ +-- | 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") +