diff options
Diffstat (limited to 'tests/Data')
-rw-r--r-- | tests/Data/ByteString/Base32/HexSpec.hs | 5 | ||||
-rw-r--r-- | tests/Data/ByteString/Base32Spec.hs | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/tests/Data/ByteString/Base32/HexSpec.hs b/tests/Data/ByteString/Base32/HexSpec.hs index 7cddb69..9b2e730 100644 --- a/tests/Data/ByteString/Base32/HexSpec.hs +++ b/tests/Data/ByteString/Base32/HexSpec.hs | |||
@@ -3,7 +3,6 @@ | |||
3 | module Data.ByteString.Base32.HexSpec ( spec ) where | 3 | module Data.ByteString.Base32.HexSpec ( spec ) where |
4 | 4 | ||
5 | import Control.Applicative | 5 | import Control.Applicative |
6 | import Control.Exception | ||
7 | import Data.ByteString as BS | 6 | import Data.ByteString as BS |
8 | import Data.ByteString.Char8 as BC | 7 | import Data.ByteString.Char8 as BC |
9 | import Data.ByteString.Base32.Hex | 8 | import Data.ByteString.Base32.Hex |
@@ -44,8 +43,8 @@ spec = do | |||
44 | decode (BC.map toLower (encode bs)) == Right bs | 43 | decode (BC.map toLower (encode bs)) == Right bs |
45 | 44 | ||
46 | it "fail gracefully if encoded data contains non alphabet chars" $ do | 45 | it "fail gracefully if encoded data contains non alphabet chars" $ do |
47 | evaluate (decode "#=======") `shouldThrow` anyErrorCall | 46 | decode "#=======" `shouldBe` Left "'#' is not base32 character" |
48 | evaluate (decode "AAAAAAAA#=======") `shouldThrow` anyErrorCall | 47 | decode "AAAAAAAA#=======" `shouldBe` Left "'#' is not base32 character" |
49 | 48 | ||
50 | describe "decodeLenient" $ do | 49 | describe "decodeLenient" $ do |
51 | it "conform RFC examples" $ do | 50 | it "conform RFC examples" $ do |
diff --git a/tests/Data/ByteString/Base32Spec.hs b/tests/Data/ByteString/Base32Spec.hs index 4cec8f9..6bd7545 100644 --- a/tests/Data/ByteString/Base32Spec.hs +++ b/tests/Data/ByteString/Base32Spec.hs | |||
@@ -3,7 +3,6 @@ | |||
3 | module Data.ByteString.Base32Spec (spec) where | 3 | module Data.ByteString.Base32Spec (spec) where |
4 | 4 | ||
5 | import Control.Applicative | 5 | import Control.Applicative |
6 | import Control.Exception | ||
7 | import Data.ByteString as BS | 6 | import Data.ByteString as BS |
8 | import Data.ByteString.Char8 as BC | 7 | import Data.ByteString.Char8 as BC |
9 | import Data.ByteString.Base32 as Base32 | 8 | import Data.ByteString.Base32 as Base32 |
@@ -50,8 +49,8 @@ spec = do | |||
50 | decode (BC.map toLower (encode bs)) == Right bs | 49 | decode (BC.map toLower (encode bs)) == Right bs |
51 | 50 | ||
52 | it "fail gracefully if encoded data contains non alphabet chars" $ do | 51 | it "fail gracefully if encoded data contains non alphabet chars" $ do |
53 | evaluate (decode "0=======") `shouldThrow` anyErrorCall | 52 | decode "0=======" `shouldBe` Left "'0' is not base32 character" |
54 | evaluate (decode "AAAAAAAA0=======") `shouldThrow` anyErrorCall | 53 | decode "AAAAAAAA0=======" `shouldBe` Left "'0' is not base32 character" |
55 | 54 | ||
56 | describe "decodeLenient" $ do | 55 | describe "decodeLenient" $ do |
57 | it "conform RFC examples" $ do | 56 | it "conform RFC examples" $ do |