Skip to content

Commit 61eeeec

Browse files
committed
Add test for fromFunction.
1 parent 7ffc123 commit 61eeeec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/seq-properties.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ main = defaultMain
3636
, testProperty "(|>)" prop_snoc
3737
, testProperty "(><)" prop_append
3838
, testProperty "fromList" prop_fromList
39+
, testProperty "fromFunction" prop_fromFunction
3940
, testProperty "replicate" prop_replicate
4041
, testProperty "replicateA" prop_replicateA
4142
, testProperty "replicateM" prop_replicateM
@@ -270,6 +271,10 @@ prop_fromList :: [A] -> Bool
270271
prop_fromList xs =
271272
toList' (fromList xs) ~= xs
272273

274+
prop_fromFunction :: [A] -> Bool
275+
prop_fromFunction xs =
276+
toList' (fromFunction (Prelude.length xs) (xs!!)) ~= xs
277+
273278
-- ** Repetition
274279

275280
prop_replicate :: NonNegative Int -> A -> Bool

0 commit comments

Comments
 (0)