diff options
Diffstat (limited to 'tests/Data/Torrent')
-rw-r--r-- | tests/Data/Torrent/InfoHashSpec.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/Data/Torrent/InfoHashSpec.hs b/tests/Data/Torrent/InfoHashSpec.hs index afa017ef..3cc110c1 100644 --- a/tests/Data/Torrent/InfoHashSpec.hs +++ b/tests/Data/Torrent/InfoHashSpec.hs | |||
@@ -3,6 +3,7 @@ module Data.Torrent.InfoHashSpec (spec) where | |||
3 | 3 | ||
4 | import Control.Applicative | 4 | import Control.Applicative |
5 | import Data.ByteString as BS | 5 | import Data.ByteString as BS |
6 | import Data.Convertible | ||
6 | import Data.Maybe | 7 | import Data.Maybe |
7 | import System.FilePath | 8 | import System.FilePath |
8 | import Test.Hspec | 9 | import Test.Hspec |
@@ -16,7 +17,7 @@ import Data.Torrent.InfoHash as IH | |||
16 | instance Arbitrary InfoHash where | 17 | instance Arbitrary InfoHash where |
17 | arbitrary = do | 18 | arbitrary = do |
18 | bs <- BS.pack <$> vectorOf 20 arbitrary | 19 | bs <- BS.pack <$> vectorOf 20 arbitrary |
19 | pure $ fromMaybe (error "arbitrary infohash") $ byteStringToInfoHash bs | 20 | pure $ either (const (error "arbitrary infohash")) id $ safeConvert bs |
20 | 21 | ||
21 | type TestPair = (FilePath, String) | 22 | type TestPair = (FilePath, String) |
22 | 23 | ||