@@ -100,14 +100,16 @@ tl_utf32BE = forAll genUnicode $ (EL.decodeUtf32BE . EL.encodeUtf32BE) `eq` id
100t_utf8_incr = do
100t_utf8_incr = do
101 Positive n <- arbitrary
101 Positive n <- arbitrary
102 forAll genUnicode $ recode n `eq` id
102 forAll genUnicode $ recode n `eq` id
103− where recode n = T.concat . feedChunksOf n E.streamDecodeUtf8 . E.encodeUtf8
103+ where recode n = T.concat . map fst . feedChunksOf n E.streamDecodeUtf8 .
104− feedChunksOf :: Int -> (B.ByteString -> E.Decoding) -> B.ByteString
106+feedChunksOf :: Int -> (B.ByteString -> E.Decoding) -> B.ByteString
105− -> [T.Text]
107+ -> [(T.Text, B.ByteString)]
106− feedChunksOf n f bs
108+feedChunksOf n f bs
107− | B.null bs = []
109+ | B.null bs = []
108− | otherwise = let (a,b) = B.splitAt n bs
110+ | otherwise = let (x,y) = B.splitAt n bs
109− E.Some t _ f' = f a
111+ E.Some t b f' = f x
110− in t : feedChunksOf n f' b
112+ in (t,b) : feedChunksOf n f' y
112data Badness = Solo | Leading | Trailing
114data Badness = Solo | Leading | Trailing
113 deriving (Eq, Show)
115 deriving (Eq, Show)