summaryrefslogtreecommitdiff
path: root/tests/Data/Torrent/InfoHashSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Data/Torrent/InfoHashSpec.hs')
-rw-r--r--tests/Data/Torrent/InfoHashSpec.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/Data/Torrent/InfoHashSpec.hs b/tests/Data/Torrent/InfoHashSpec.hs
index ba9ce9a4..afa017ef 100644
--- a/tests/Data/Torrent/InfoHashSpec.hs
+++ b/tests/Data/Torrent/InfoHashSpec.hs
@@ -2,6 +2,8 @@
2module Data.Torrent.InfoHashSpec (spec) where 2module Data.Torrent.InfoHashSpec (spec) where
3 3
4import Control.Applicative 4import Control.Applicative
5import Data.ByteString as BS
6import Data.Maybe
5import System.FilePath 7import System.FilePath
6import Test.Hspec 8import Test.Hspec
7import Test.QuickCheck 9import Test.QuickCheck
@@ -12,7 +14,9 @@ import Data.Torrent.InfoHash as IH
12 14
13 15
14instance Arbitrary InfoHash where 16instance Arbitrary InfoHash where
15 arbitrary = IH.hash <$> arbitrary 17 arbitrary = do
18 bs <- BS.pack <$> vectorOf 20 arbitrary
19 pure $ fromMaybe (error "arbitrary infohash") $ byteStringToInfoHash bs
16 20
17type TestPair = (FilePath, String) 21type TestPair = (FilePath, String)
18 22