on master help sign in
A few more filtered stream tests.

--HG-- extra : convert_revision : 67ea62f1d0a0ffed57b0428f902111bef9cd945d

commita0c21fded86b422cfcb5efd9cfec1d9213eac695 authorBryan O'Sullivan <bos@serpentine.com> dateSat 15 Aug 2009, 05:55 (17 years ago) parentb4e0f91
1 file changed+6−2
tests/Properties.hs+6−2
tests/Properties.hs+6−2
@@ -144,13 +144,15 @@ prop_T_IsString = fromString `eqP` (T.unpack . fromString)
144144prop_TL_IsString = fromString `eqP` (TL.unpack . fromString)
145145
146146prop_S_cons x = (x:) `eqP` (unpackS . S.cons x)
147+prop_Sf_cons p x = ((x:) . L.filter p) `eqP` (unpackS . S.cons x . S.filter p)
147148prop_T_cons x = (x:) `eqP` (unpackS . T.cons x)
148149prop_TL_cons x = (x:) `eqP` (unpackS . TL.cons x)
149150prop_S_snoc x = (++ [x]) `eqP` (unpackS . (flip S.snoc) x)
150151prop_T_snoc x = (++ [x]) `eqP` (unpackS . (flip T.snoc) x)
151152prop_TL_snoc x = (++ [x]) `eqP` (unpackS . (flip TL.snoc) x)
153+prop_S_append s = (s++) `eqP` (unpackS . S.append (S.streamList s))
154+prop_Sf_append p s = (L.filter p s++) `eqP` (unpackS . S.append (S.filter p $ S.streamList s))
152155prop_T_append s = (s++) `eqP` (unpackS . T.append (packS s))
153−prop_T_appendS s = (s++) `eqP` (unpackS . S.unstream . S.append (S.stream (packS s)) . S.stream)
154156
155157uncons (x:xs) = Just (x,xs)
156158uncons _ = Nothing
@@ -475,13 +477,15 @@ tests = [
475477
476478 testGroup "basics" [
477479 testProperty "s_cons" prop_S_cons,
480+ testProperty "sf_cons" prop_Sf_cons,
478481 testProperty "t_cons" prop_T_cons,
479482 testProperty "tl_cons" prop_TL_cons,
480483 testProperty "s_snoc" prop_S_snoc,
481484 testProperty "t_snoc" prop_T_snoc,
482485 testProperty "tl_snoc" prop_TL_snoc,
486+ testProperty "s_append" prop_S_append,
487+ testProperty "sf_append" prop_Sf_append,
483488 testProperty "t_append" prop_T_append,
484− testProperty "t_appendS" prop_T_appendS,
485489 testProperty "t_uncons" prop_T_uncons,
486490 testProperty "tl_uncons" prop_TL_uncons,
487491 testProperty "s_head" prop_S_head,