on master help sign in
Write a regression test for filtered stream equality

--HG-- extra : convert_revision : ef8aa4279edd78606c5288f329fcc28e22de0fd9

commit5a2daa375dc4dbf6b7b6220e0bbc6ea296bea209 authorBryan O'Sullivan <bos@serpentine.com> dateSat 28 Feb 2009, 21:49 (18 years ago) parent7565180
1 file changed+8−1
tests/Properties.hs+8−1
tests/Properties.hs+8−1
@@ -208,6 +208,11 @@ prop_T_elemIndices c = L.elemIndices c`eqP` T.elemIndices c
208208prop_T_count c = (L.length . L.elemIndices c) `eqP` T.count c
209209prop_T_zipWith c s = L.zipWith c s `eqP` (T.unpack . T.zipWith c (T.pack s))
210210
211+-- Regression tests.
212+prop_S_filter_eq s = S.filter p t == S.streamList (filter p s)
213+ where p = (/= S.last t)
214+ t = S.streamList s
215+
211216-- Make a stream appear shorter than it really is, to ensure that
212217-- functions that consume inaccurately sized streams behave
213218-- themselves.
@@ -335,5 +340,7 @@ tests = [
335340 ("prop_T_elemIndex", mytest prop_T_elemIndex),
336341 ("prop_T_elemIndices", mytest prop_T_elemIndices),
337342 ("prop_T_count", mytest prop_T_count),
338− ("prop_T_zipWith", mytest prop_T_zipWith)
343+ ("prop_T_zipWith", mytest prop_T_zipWith),
344+
345+ ("prop_S_filter_eq", mytest prop_S_filter_eq)
339346 ]