From 1b29012aa1e98cbd35bf5fc2c2d076a38a04da3b Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Wed, 26 Jul 2017 17:28:42 +0530 Subject: [PATCH] Add one more metainfo test --- test/MetainfoTests.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/MetainfoTests.hs b/test/MetainfoTests.hs index 86ecf48..824bb64 100644 --- a/test/MetainfoTests.hs +++ b/test/MetainfoTests.hs @@ -11,7 +11,13 @@ import Data.ByteString (readFile) tests :: IO () tests = hspec $ do describe "read and interpret a torrent file 1" $ do - it "valid announceList" $ do + it "valid torrent file" $ do fc <- readFile "data/debian-7.8.0-amd64-CD-1.iso.torrent" (torrentToMetainfo fc) `shouldNotBe` (Left "parse error") + it "valid announce list" $ do + fc <- readFile "data/debian-7.8.0-amd64-CD-1.iso.torrent" + case torrentToMetainfo fc of + Left _ -> pending + Right metainfo -> do + announceList metainfo `shouldNotBe` [] -- 2.37.2