]> git.rkrishnan.org Git - functorrent.git/blobdiff - test/MetainfoTests.hs
add a very simple Metainfo test
[functorrent.git] / test / MetainfoTests.hs
diff --git a/test/MetainfoTests.hs b/test/MetainfoTests.hs
new file mode 100644 (file)
index 0000000..86ecf48
--- /dev/null
@@ -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")
+