summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-01-05 22:58:25 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-01-05 22:58:25 +0400
commit29036b62a5da2505862c904bc069c7b0b94129e4 (patch)
treee34734c822f525c2afbee720609ab5070146d2ac /tests
parent8d194406c7d23e610bf5227f52ee8e04a555e85d (diff)
Implement getBitfield and genPieceInfo functions
Diffstat (limited to 'tests')
-rw-r--r--tests/System/Torrent/StorageSpec.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/System/Torrent/StorageSpec.hs b/tests/System/Torrent/StorageSpec.hs
index 2e94ccf1..40eaa9c7 100644
--- a/tests/System/Torrent/StorageSpec.hs
+++ b/tests/System/Torrent/StorageSpec.hs
@@ -8,6 +8,7 @@ import System.Directory
8import System.IO.Unsafe 8import System.IO.Unsafe
9import Test.Hspec 9import Test.Hspec
10 10
11import Data.Torrent.Bitfield as BF
11import Data.Torrent.Layout 12import Data.Torrent.Layout
12import Data.Torrent.Piece 13import Data.Torrent.Piece
13import System.Torrent.Storage 14import System.Torrent.Storage
@@ -86,3 +87,9 @@ spec = before createLayout $ do
86 sourceStorage s $= C.map bzeroPiece $$ sinkStorage s 87 sourceStorage s $= C.map bzeroPiece $$ sinkStorage s
87 b <- sourceStorage s $$ C.fold (\ b p -> b && isZeroPiece p) True 88 b <- sourceStorage s $$ C.fold (\ b p -> b && isZeroPiece p) True
88 b `shouldBe` True 89 b `shouldBe` True
90
91 describe "genPieceInfo" $ do
92 it "" $ do
93 withStorage ReadWrite psize layout $ \ s -> do
94 bf <- genPieceInfo s >>= getBitfield s
95 bf `shouldSatisfy` BF.full \ No newline at end of file