diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-28 15:24:48 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-28 15:24:48 +0400 |
commit | e2edd7436a287160d993815e2dc1ad9792435b9c (patch) | |
tree | 9295e22134bdca5f4fdb12c67a2b986a667f26b8 /tests/Data/Torrent | |
parent | 2d1b6b54825fd3f072bd81ac94106edd04cf52bb (diff) |
Remove byteStringToInfoHash function
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 | ||