on master help sign in
Properties: add a prop, reveal a bug in unstreamChunks.
7d48537Nicolas Pouillard
tests/Properties.hs+3
@@ -42,6 +42,8 @@ prop_TL_stream_unstream = (SL.unstream . SL.stream) `eq` id
42prop_T_reverse_stream t = (S.reverse . S.reverseStream) t == t
42prop_T_reverse_stream t = (S.reverse . S.reverseStream) t == t
43prop_T_singleton c = [c] == (T.unpack . T.singleton) c
43prop_T_singleton c = [c] == (T.unpack . T.singleton) c
44prop_TL_singleton c = [c] == (TL.unpack . TL.singleton) c
44prop_TL_singleton c = [c] == (TL.unpack . TL.singleton) c
45+prop_TL_unstreamChunks x = f 11 x == f 1000 x
46+ where f n = SL.unstreamChunks n . S.streamList
45
47
46prop_T_ascii t = E.decodeASCII (E.encodeUtf8 a) == a
48prop_T_ascii t = E.decodeASCII (E.encodeUtf8 a) == a
47 where a = T.map (\c -> chr (ord c `mod` 128)) t
49 where a = T.map (\c -> chr (ord c `mod` 128)) t
@@ -330,6 +332,7 @@ tests = [
330 ("prop_T_reverse_stream", mytest prop_T_reverse_stream),
332 ("prop_T_reverse_stream", mytest prop_T_reverse_stream),
331 ("prop_T_singleton", mytest prop_T_singleton),
333 ("prop_T_singleton", mytest prop_T_singleton),
332 ("prop_TL_singleton", mytest prop_TL_singleton),
334 ("prop_TL_singleton", mytest prop_TL_singleton),
335+ ("prop_TL_unstreamChunks", mytest prop_TL_unstreamChunks),
333
336
334 ("prop_T_ascii", mytest prop_T_ascii),
337 ("prop_T_ascii", mytest prop_T_ascii),
335 ("prop_T_utf8", mytest prop_T_utf8),
338 ("prop_T_utf8", mytest prop_T_utf8),