[commit: packages/containers] develop-0.6, develop-0.6-questionable, master: Add test for fromFunction. (61eeeec)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 22:41:00 UTC 2015


Repository : ssh://git@git.haskell.org/containers

On branches: develop-0.6,develop-0.6-questionable,master
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