[commit: packages/text] master: add an extra test that correct utf8 doesn't disappear (d42bafb)

git at git.haskell.org git at git.haskell.org
Tue Aug 8 15:23:19 UTC 2017


Repository : ssh://git@git.haskell.org/text

On branch  : master
Link       : http://git.haskell.org/packages/text.git/commitdiff/d42bafbf7709964e86e3b315a9ae4d7bee17847b

>---------------------------------------------------------------

commit d42bafbf7709964e86e3b315a9ae4d7bee17847b
Author: Kubo Kovac <kuko at fb.com>
Date:   Mon May 22 17:58:43 2017 +0100

    add an extra test that correct utf8 doesn't disappear


>---------------------------------------------------------------

d42bafbf7709964e86e3b315a9ae4d7bee17847b
 tests/Tests/Properties.hs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/Tests/Properties.hs b/tests/Tests/Properties.hs
index 04156d9..ec9a1fd 100644
--- a/tests/Tests/Properties.hs
+++ b/tests/Tests/Properties.hs
@@ -203,6 +203,10 @@ t_decode_with_error4' =
   case E.streamDecodeUtf8With (\_ _ -> Just 'x') (B.pack [0xC2, 97, 97, 97]) of
     E.Some x _ _ -> x === "xaaa"
 
+t_infix_concat bs1 text bs2 rep =
+  text `T.isInfixOf`
+    E.decodeUtf8With (\_ _ -> rep) (B.concat [bs1, E.encodeUtf8 text, bs2])
+
 s_Eq s            = (s==)    `eq` ((S.streamList s==) . S.streamList)
     where _types = s :: String
 sf_Eq p s =
@@ -985,7 +989,8 @@ tests =
         testProperty "t_decode_with_error4" t_decode_with_error4,
         testProperty "t_decode_with_error2'" t_decode_with_error2',
         testProperty "t_decode_with_error3'" t_decode_with_error3',
-        testProperty "t_decode_with_error4'" t_decode_with_error4'
+        testProperty "t_decode_with_error4'" t_decode_with_error4',
+        testProperty "t_infix_concat" t_infix_concat
       ]
     ],
 



More information about the ghc-commits mailing list