diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-28 06:54:51 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-28 06:54:51 +0400 |
commit | 53d47a403f8e940f6f55f292c3d5d4b2edc0b3cb (patch) | |
tree | 2675d9309f1412510dccbc8bb64e1b4fe4e48920 /tests | |
parent | 32027c2d4392fb6964bafe3aaf6d427e5d827d21 (diff) |
Hide InfoHash internal functions
Diffstat (limited to 'tests')
-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 | ||