3535 «•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•»«•» -}
3636
3737{- -
38- * Properties of the /Prelude/ .
38+ * Properties of the _Prelude_ .
3939 -}
4040
41- {-
42- * $Revision$
43- * $Header: E:/iwcvs/fc/frege/test/PreludeProperties.fr,v 1.5 2009/04/24 19:09:19 iw Exp $
44- * $Log: PreludeProperties.fr,v $
45- -}
4641
4742package frege. PreludeProperties where
4843
4944import Data.List
5045
5146import frege.prelude.Math (floor )
52- import frege.lib.QuickCheck
53- -- import frege.prelude.PreludeList (union)
47+ import Test.QuickCheck
48+
49+ trivial = (`classify` " trivial" )
5450
5551--* a generator for all 16 - bit characters
5652chars = arbitrary:: Gen Char
@@ -75,6 +71,8 @@ derive Show Small
7571derive Enum Small
7672instance Arbitrary Small where
7773 arbitrary = elements [SA .. SM ]
74+
75+ instance CoArbitrary Small where
7876 coarbitrary n = variant (ord n)
7977
8078-- funs = oneof [(Int.+), (-)::Int->Int->Int, Int.min, Int.max] :: Gen (Int->Int->Int)
@@ -314,7 +312,9 @@ p_listDiff = property difflaw where
314312 difflaw :: [Char ] -> [Char ] -> Bool
315313 difflaw xs ys =
316314 (xs ++ ys) \\ xs == ys
317-
315+
316+ p_False = once false
317+
318318main _ = do
319319 -- stop at first failed test
320320 allSingle <- foldM (checkAnd 1 ) true singleChecks
@@ -326,7 +326,8 @@ main _ = do
326326 else System. exit 1
327327 where
328328 checkAnd n false prop = return false
329- checkAnd n true prop = check quick. {configMaxTest = n} prop
329+ checkAnd n true prop = quickCheckWithResult stdArgs. {maxSuccess = n} prop
330+ >>= return . isSuccess
330331 singleChecks = [p_DataList]
331332 laws = [ p_MatcherEquivMatchGroup0, p_listDiff ]
332333 checks = [ p_OrdChar, p_DoubleRoundFloor, p_Equality, p_FloatRoundFloor,
0 commit comments