summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-09-26 21:36:32 +0400
committerSam T <pxqr.sta@gmail.com>2013-09-26 21:36:32 +0400
commitefc54d7c09e4e018c3729f2144a7fade49360f56 (patch)
treea28e2f6d49fdb1904354432a926111e1dca1b4de
parent214e969577c2ad104bd052ec699ecd950f2f445f (diff)
Ignore error if character is out of base32 alphabet
3.3. Interpretation of Non-Alphabet Characters in Encoded Data
-rw-r--r--tests/Data/ByteString/Base32Spec.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/Data/ByteString/Base32Spec.hs b/tests/Data/ByteString/Base32Spec.hs
index 3c646e2..ff3e13c 100644
--- a/tests/Data/ByteString/Base32Spec.hs
+++ b/tests/Data/ByteString/Base32Spec.hs
@@ -2,6 +2,7 @@
2module Data.ByteString.Base32Spec (spec) where 2module Data.ByteString.Base32Spec (spec) where
3 3
4import Control.Applicative 4import Control.Applicative
5import Control.Exception
5import Data.ByteString as BS 6import Data.ByteString as BS
6import Data.ByteString.Internal as BS 7import Data.ByteString.Internal as BS
7import Data.ByteString.Base32 as Base32 8import Data.ByteString.Base32 as Base32
@@ -43,4 +44,8 @@ spec = do
43 it "inverse for encode" $ property $ \bs -> 44 it "inverse for encode" $ property $ \bs ->
44 decode (encode bs) == bs 45 decode (encode bs) == bs
45 46
47 it "fail gracefully if encoded data contains non alphabet chars" $ do
48 evaluate (decode "0=======") `shouldThrow` anyErrorCall
49 evaluate (decode "AAAAAAAA0=======") `shouldThrow` anyErrorCall
50
46-- describe "decodeLenient" $ do 51-- describe "decodeLenient" $ do