projects
/
functorrent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b745c1b
)
metainfotest: add a piecelength test
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Wed, 26 Jul 2017 13:37:21 +0000
(19:07 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Wed, 26 Jul 2017 13:37:21 +0000
(19:07 +0530)
test/MetainfoTests.hs
patch
|
blob
|
history
diff --git
a/test/MetainfoTests.hs
b/test/MetainfoTests.hs
index 727de500e705981e0bb3c6acbd9c972a88def022..f27486f7efa6ce5b86c6d779c56aa229be365d06 100644
(file)
--- a/
test/MetainfoTests.hs
+++ b/
test/MetainfoTests.hs
@@
-19,5
+19,12
@@
tests = hspec $ do
case torrentToMetainfo fc of
Left _ -> pending
Right metainfo -> do
- announceList metainfo `shouldSatisfy` (not . null)
+ announceList metainfo `shouldSatisfy` (not . null)
+ it "valid piece length" $ do
+ fc <- readFile "data/debian-7.8.0-amd64-CD-1.iso.torrent"
+ case torrentToMetainfo fc of
+ Left _ -> pending
+ Right metainfo -> do
+ let (Just info') = info metainfo
+ pieceLength info' `shouldBe` (524288 :: Integer)