diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Network/BitTorrent/DHT/SessionSpec.hs | 1 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Exchange/DownloadSpec.hs | 14 |
2 files changed, 2 insertions, 13 deletions
diff --git a/tests/Network/BitTorrent/DHT/SessionSpec.hs b/tests/Network/BitTorrent/DHT/SessionSpec.hs index 522bd8df..a5376c32 100644 --- a/tests/Network/BitTorrent/DHT/SessionSpec.hs +++ b/tests/Network/BitTorrent/DHT/SessionSpec.hs | |||
@@ -5,6 +5,7 @@ import Control.Concurrent | |||
5 | import Control.Exception | 5 | import Control.Exception |
6 | import Control.Monad.Reader | 6 | import Control.Monad.Reader |
7 | import Control.Monad.Trans.Resource | 7 | import Control.Monad.Trans.Resource |
8 | import Data.Conduit.Lazy | ||
8 | import Data.Default | 9 | import Data.Default |
9 | import Data.List as L | 10 | import Data.List as L |
10 | import Test.Hspec | 11 | import Test.Hspec |
diff --git a/tests/Network/BitTorrent/Exchange/DownloadSpec.hs b/tests/Network/BitTorrent/Exchange/DownloadSpec.hs index a0d40af3..d46f2034 100644 --- a/tests/Network/BitTorrent/Exchange/DownloadSpec.hs +++ b/tests/Network/BitTorrent/Exchange/DownloadSpec.hs | |||
@@ -33,19 +33,7 @@ withUpdates m = do | |||
33 | undefined | 33 | undefined |
34 | 34 | ||
35 | simulateFetch :: InfoDict -> Updates s (Maybe InfoDict) | 35 | simulateFetch :: InfoDict -> Updates s (Maybe InfoDict) |
36 | simulateFetch dict = go | 36 | simulateFetch dict = undefined |
37 | where | ||
38 | blocks = chunkBy metadataPieceSize (BL.toStrict (BE.encode dict)) | ||
39 | packPiece ix = Torrent.Piece ix (blocks !! ix) | ||
40 | ih = idInfoHash dict | ||
41 | |||
42 | go = do | ||
43 | mix <- scheduleBlock undefined undefined | ||
44 | case mix of | ||
45 | Nothing -> return Nothing | ||
46 | Just ix -> do | ||
47 | mdict <- pushBlock undefined (packPiece ix) | ||
48 | maybe go (return . Just) mdict | ||
49 | 37 | ||
50 | spec :: Spec | 38 | spec :: Spec |
51 | spec = do | 39 | spec = do |