@@ -73,19 +73,33 @@ prop_minimum = L.minimum `eqEP` T.minimum
74prop_scanl f z = L.scanl f z `eqP` (unpack . T.scanl f z)
74prop_scanl f z = L.scanl f z `eqP` (unpack . T.scanl f z)
76+prop_replicate n = L.replicate n `eq` (unpack . T.replicate n)
77+prop_unfoldr f = L.unfoldr f `eq` (unpack . T.unfoldr f)
78+ where types = f :: Int -> Maybe (Char,Int)
79+prop_unfoldrN n f = (L.take n . L.unfoldr f) `eq` (unpack . T.unfoldrN n f)
80+ where types = f :: Int -> Maybe (Char,Int)
76prop_take n = L.take n `eqP` (unpack . T.take n)
82prop_take n = L.take n `eqP` (unpack . T.take n)
77prop_drop n = L.drop n `eqP` (unpack . T.drop n)
83prop_drop n = L.drop n `eqP` (unpack . T.drop n)
78prop_takeWhile p = L.takeWhile p `eqP` (unpack . T.takeWhile p)
84prop_takeWhile p = L.takeWhile p `eqP` (unpack . T.takeWhile p)
79prop_dropWhile p = L.dropWhile p `eqP` (unpack . T.dropWhile p)
85prop_dropWhile p = L.dropWhile p `eqP` (unpack . T.dropWhile p)
86+prop_inits = L.inits `eqP` (map unpack . T.inits)
87+prop_tails = L.tails `eqP` (map unpack . T.tails)
89+prop_lines = L.lines `eqP` (map unpack . T.lines)
90+prop_words = L.words `eqP` (map unpack . T.words)
91+prop_unlines = L.unlines `eq` (unpack . T.unlines . map pack)
92+prop_unwords = L.unwords `eq` (unpack . T.unwords . map pack)
80prop_elem c = L.elem c `eqP` T.elem c
94prop_elem c = L.elem c `eqP` T.elem c
81−prop_find p = L.find p `eqP` T.find p
82prop_filter p = L.filter p `eqP` (unpack . T.filter p)
95prop_filter p = L.filter p `eqP` (unpack . T.filter p)
96+prop_find p = L.find p `eqP` T.find p
83prop_index x s = x < L.length s && x >= 0 ==>
98prop_index x s = x < L.length s && x >= 0 ==>
84 (L.!!) s x == T.index (pack s) x
99 (L.!!) s x == T.index (pack s) x
85prop_findIndex p = L.findIndex p `eqP` T.findIndex p
100prop_findIndex p = L.findIndex p `eqP` T.findIndex p
86prop_elemIndex c = L.elemIndex c `eqP` T.elemIndex c
101prop_elemIndex c = L.elemIndex c `eqP` T.elemIndex c
87prop_zipWith c s = L.zipWith c s `eqP` (unpack . T.zipWith c (pack s))
102prop_zipWith c s = L.zipWith c s `eqP` (unpack . T.zipWith c (pack s))
88−prop_words = L.words `eqP` (L.map unpack . T.words)
90main = run tests =<< getArgs
104main = run tests =<< getArgs
@@ -143,16 +157,28 @@ tests = [
144 ("prop_scanl", mytest prop_scanl),
158 ("prop_scanl", mytest prop_scanl),
160+ ("prop_replicate", mytest prop_replicate),
161+--("prop_unfoldr", mytest prop_unfoldr),
162+--("prop_unfoldrN", mytest prop_unfoldrN),
146 ("prop_take", mytest prop_take),
164 ("prop_take", mytest prop_take),
147 ("prop_drop", mytest prop_drop),
165 ("prop_drop", mytest prop_drop),
148 ("prop_takeWhile", mytest prop_takeWhile),
166 ("prop_takeWhile", mytest prop_takeWhile),
149 ("prop_dropWhile", mytest prop_dropWhile),
167 ("prop_dropWhile", mytest prop_dropWhile),
168+ ("prop_inits", mytest prop_inits),
169+ ("prop_tails", mytest prop_tails),
171+ ("prop_lines", mytest prop_lines),
172+ ("prop_words", mytest prop_words),
173+ ("prop_unlines", mytest prop_unlines),
174+ ("prop_unwords", mytest prop_unwords),
150 ("prop_elem", mytest prop_elem),
176 ("prop_elem", mytest prop_elem),
151− ("prop_find", mytest prop_find),
152 ("prop_filter", mytest prop_filter),
177 ("prop_filter", mytest prop_filter),
178+ ("prop_find", mytest prop_find),
153 ("prop_index", mytest prop_index),
180 ("prop_index", mytest prop_index),
154 ("prop_findIndex", mytest prop_findIndex),
181 ("prop_findIndex", mytest prop_findIndex),
155 ("prop_elemIndex", mytest prop_elemIndex),
182 ("prop_elemIndex", mytest prop_elemIndex),
156− ("prop_zipWith", mytest prop_zipWith),
183+ ("prop_zipWith", mytest prop_zipWith)
157− ("prop_words", mytest prop_words)