[commit: packages/containers] changelog-foldtree, cleaned_bugfix394, develop-0.6, develop-0.6-questionable, master, merge-doc-target, merge-fixes-5.9, merge-restrict-fix-5.8, revert-184-generic, revert-408-bugfix_394: Add test for fromFunction. (61eeeec)
git at git.haskell.org
git at git.haskell.org
Mon Apr 17 21:35:57 UTC 2017
Repository : ssh://git@git.haskell.org/containers
On branches: changelog-foldtree,cleaned_bugfix394,develop-0.6,develop-0.6-questionable,master,merge-doc-target,merge-fixes-5.9,merge-restrict-fix-5.8,revert-184-generic,revert-408-bugfix_394
Link : http://git.haskell.org/packages/containers.git/commitdiff/61eeeec856e39108ba3d5cb4251b249acc782305
>---------------------------------------------------------------
commit 61eeeec856e39108ba3d5cb4251b249acc782305
Author: Milan Straka <fox at ucw.cz>
Date: Sun Dec 14 16:49:49 2014 +0100
Add test for fromFunction.
>---------------------------------------------------------------
61eeeec856e39108ba3d5cb4251b249acc782305
tests/seq-properties.hs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/seq-properties.hs b/tests/seq-properties.hs
index 74b2e9c..14d5a5f 100644
--- a/tests/seq-properties.hs
+++ b/tests/seq-properties.hs
@@ -36,6 +36,7 @@ main = defaultMain
, testProperty "(|>)" prop_snoc
, testProperty "(><)" prop_append
, testProperty "fromList" prop_fromList
+ , testProperty "fromFunction" prop_fromFunction
, testProperty "replicate" prop_replicate
, testProperty "replicateA" prop_replicateA
, testProperty "replicateM" prop_replicateM
@@ -270,6 +271,10 @@ prop_fromList :: [A] -> Bool
prop_fromList xs =
toList' (fromList xs) ~= xs
+prop_fromFunction :: [A] -> Bool
+prop_fromFunction xs =
+ toList' (fromFunction (Prelude.length xs) (xs!!)) ~= xs
+
-- ** Repetition
prop_replicate :: NonNegative Int -> A -> Bool
More information about the ghc-commits
mailing list