[commit: bytestring] master: Added tests for toStrict and fromStrict (51dd02b)
Ian Lynagh
igloo at earth.li
Wed Feb 22 21:58:07 CET 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/bytestring
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/51dd02bd37a0df53636fbc6a8ed0bfda2f3531e5
>---------------------------------------------------------------
commit 51dd02bd37a0df53636fbc6a8ed0bfda2f3531e5
Author: Duncan Coutts <duncan at community.haskell.org>
Date: Mon Nov 7 12:44:59 2011 +0000
Added tests for toStrict and fromStrict
>---------------------------------------------------------------
tests/Properties.hs | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/tests/Properties.hs b/tests/Properties.hs
index 0d75341..8599472 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -1478,6 +1478,12 @@ prop_unpackpack_l x = (L.pack . L.unpack) x == x
prop_packunpack_lc x = (LC.unpack . LC.pack) x == x
prop_unpackpack_lc x = (LC.pack . LC.unpack) x == x
+prop_toFromChunks x = (L.fromChunks . L.toChunks) x == x
+prop_fromToChunks x = (L.toChunks . L.fromChunks) x == filter (not . P.null) x
+
+prop_toFromStrict x = (L.fromStrict . L.toStrict) x == x
+prop_fromToStrict x = (L.toStrict . L.fromStrict) x == x
+
prop_packUptoLenBytes cs =
forAll (choose (0, length cs + 1)) $ \n ->
let (bs, cs') = P.packUptoLenBytes n cs
@@ -1786,6 +1792,11 @@ misc_tests =
,("unpackAppendCharsLazy", mytest prop_unpackAppendCharsLazy)
,("unpackAppendBytesStrict",mytest prop_unpackAppendBytesStrict)
,("unpackAppendCharsStrict",mytest prop_unpackAppendCharsStrict)
+ ,("toFromChunks", mytest prop_toFromChunks)
+ ,("fromToChunks", mytest prop_fromToChunks)
+ ,("toFromStrict", mytest prop_toFromStrict)
+ ,("fromToStrict", mytest prop_fromToStrict)
+
,("invariant", mytest prop_invariant)
,("unsafe pack address", mytest prop_unsafePackAddress)
,("unsafe pack address len",mytest prop_unsafePackAddressLen)
More information about the Cvs-libraries
mailing list