diff options
Diffstat (limited to 'tests/System/Torrent')
-rw-r--r-- | tests/System/Torrent/StorageSpec.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/System/Torrent/StorageSpec.hs b/tests/System/Torrent/StorageSpec.hs index d2185961..2e94ccf1 100644 --- a/tests/System/Torrent/StorageSpec.hs +++ b/tests/System/Torrent/StorageSpec.hs | |||
@@ -52,8 +52,12 @@ spec = before createLayout $ do | |||
52 | it "should fail on out of upper bound index" $ do | 52 | it "should fail on out of upper bound index" $ do |
53 | withStorage ReadWrite 100 layout $ \ s -> do | 53 | withStorage ReadWrite 100 layout $ \ s -> do |
54 | let bs = BL.replicate 100 0 | 54 | let bs = BL.replicate 100 0 |
55 | writePiece (Piece 1 bs) s | 55 | writePiece (Piece 0 bs) s |
56 | writePiece (Piece 2 bs) s `shouldThrow` (== InvalidIndex 2) | 56 | |
57 | let bs' = BL.replicate 75 0 | ||
58 | writePiece (Piece 1 bs') s | ||
59 | |||
60 | writePiece (Piece 2 bs') s `shouldThrow` (== InvalidIndex 2) | ||
57 | 61 | ||
58 | describe "readPiece" $ do | 62 | describe "readPiece" $ do |
59 | it "should fail on negative index" $ | 63 | it "should fail on negative index" $ |