@@ -111,6 +111,12 @@ feedChunksOf n f bs
111 E.Some t b f' = f x
111 E.Some t b f' = f x
112 in (t,b) : feedChunksOf n f' y
112 in (t,b) : feedChunksOf n f' y
114+t_utf8_undecoded = forAll genUnicode $ \t ->
115+ let b = E.encodeUtf8 t
116+ ls = concatMap (leftover . E.encodeUtf8 . T.singleton) . T.unpack $ t
117+ leftover = (++ [B.empty]) . init . tail . B.inits
118+ in (map snd . feedChunksOf 1 E.streamDecodeUtf8) b == ls
114data Badness = Solo | Leading | Trailing
120data Badness = Solo | Leading | Trailing
115 deriving (Eq, Show)
121 deriving (Eq, Show)
@@ -837,6 +843,7 @@ tests =
837 testProperty "t_utf8" t_utf8,
843 testProperty "t_utf8" t_utf8,
838 testProperty "t_utf8'" t_utf8',
844 testProperty "t_utf8'" t_utf8',
839 testProperty "t_utf8_incr" t_utf8_incr,
845 testProperty "t_utf8_incr" t_utf8_incr,
846+ testProperty "t_utf8_undecoded" t_utf8_undecoded,
840 testProperty "tl_utf8" tl_utf8,
847 testProperty "tl_utf8" tl_utf8,
841 testProperty "tl_utf8'" tl_utf8',
848 testProperty "tl_utf8'" tl_utf8',
842 testProperty "t_utf16LE" t_utf16LE,
849 testProperty "t_utf16LE" t_utf16LE,