From 53d47a403f8e940f6f55f292c3d5d4b2edc0b3cb Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Thu, 28 Nov 2013 06:54:51 +0400 Subject: Hide InfoHash internal functions --- tests/Data/Torrent/InfoHashSpec.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/Data') 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 @@ module Data.Torrent.InfoHashSpec (spec) where import Control.Applicative +import Data.ByteString as BS +import Data.Maybe import System.FilePath import Test.Hspec import Test.QuickCheck @@ -12,7 +14,9 @@ import Data.Torrent.InfoHash as IH instance Arbitrary InfoHash where - arbitrary = IH.hash <$> arbitrary + arbitrary = do + bs <- BS.pack <$> vectorOf 20 arbitrary + pure $ fromMaybe (error "arbitrary infohash") $ byteStringToInfoHash bs type TestPair = (FilePath, String) -- cgit v1.2.3