on master help sign in
Add more lazy decoding tests

--HG-- extra : convert_revision : 93b5916d22bc85020dfdf18226b331fb55c3847e

commit4dee499eeebc985ca6bc8770d0d57cb3b1fdb52b authorBryan O'Sullivan <bos@serpentine.com> dateThu 14 Oct 2010, 23:12 (16 years ago) parent74de6d0
1 file changed+11
tests/benchmarks/DecodeUtf8.hs+11
tests/benchmarks/DecodeUtf8.hs+11
@@ -37,11 +37,20 @@ lazy h = do
3737 bs <- BL.hGetContents h
3838 rnf (TL.decodeUtf8 bs) `seq` return ()
3939
40+lazy_len h = do
41+ bs <- BL.hGetContents h
42+ print . TL.length . TL.decodeUtf8 $ bs
43+
4044lazy_io h = do
4145 hSetEncoding h utf8
4246 t <- TL.hGetContents h
4347 rnf t `seq` return ()
4448
49+lazy_len_io h = do
50+ hSetEncoding h utf8
51+ t <- TL.hGetContents h
52+ print (TL.length t)
53+
4554string h = do
4655 hSetEncoding h utf8
4756 t <- hGetContents h
@@ -82,7 +91,9 @@ main = do
8291 "strict_io" -> strict_io h
8392 "strict_len_io" -> strict_len_io h
8493 "lazy" -> lazy h
94+ "lazy_len" -> lazy_len h
8595 "lazy_io" -> lazy_io h
96+ "lazy_len_io" -> lazy_len_io h
8697 "string" -> string h
8798 "string_len" -> string_len h
8899 "lazy_string_utf8" -> lazy_string_utf8 h