@@ -111,6 +111,12 @@ feedChunksOf n f bs
111111 E.Some t b f' = f x
112112 in (t,b) : feedChunksOf n f' y
113113
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
119+
114120data Badness = Solo | Leading | Trailing
115121 deriving (Eq, Show)
116122
@@ -837,6 +843,7 @@ tests =
837843 testProperty "t_utf8" t_utf8,
838844 testProperty "t_utf8'" t_utf8',
839845 testProperty "t_utf8_incr" t_utf8_incr,
846+ testProperty "t_utf8_undecoded" t_utf8_undecoded,
840847 testProperty "tl_utf8" tl_utf8,
841848 testProperty "tl_utf8'" tl_utf8',
842849 testProperty "t_utf16LE" t_utf16LE,