diff options
Diffstat (limited to 'tests/Data')
-rw-r--r-- | tests/Data/Torrent/InfoHashSpec.hs | 6 |
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 @@ | |||
2 | module Data.Torrent.InfoHashSpec (spec) where | 2 | module Data.Torrent.InfoHashSpec (spec) where |
3 | 3 | ||
4 | import Control.Applicative | 4 | import Control.Applicative |
5 | import Data.ByteString as BS | ||
6 | import Data.Maybe | ||
5 | import System.FilePath | 7 | import System.FilePath |
6 | import Test.Hspec | 8 | import Test.Hspec |
7 | import Test.QuickCheck | 9 | import Test.QuickCheck |
@@ -12,7 +14,9 @@ import Data.Torrent.InfoHash as IH | |||
12 | 14 | ||
13 | 15 | ||
14 | instance Arbitrary InfoHash where | 16 | instance 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 | ||
17 | type TestPair = (FilePath, String) | 21 | type TestPair = (FilePath, String) |
18 | 22 | ||