packages feed

QuickCheck-safe 0.1.0.4 → 0.1.0.5

raw patch · 3 files changed

+35/−9 lines, 3 filesdep +containersdep ~QuickCheckPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: containers

Dependency ranges changed: QuickCheck

API changes (from Hackage documentation)

+ Test.QuickCheck.Safe: (=/=) :: (Eq a, Show a) => a -> a -> Property
+ Test.QuickCheck.Safe: (><) :: () => Gen a -> Gen a -> Gen a -> Gen a -> Gen a -> Gen a
+ Test.QuickCheck.Safe: ASCIIString :: String -> ASCIIString
+ Test.QuickCheck.Safe: Args :: Maybe (QCGen, Int) -> Int -> Int -> Int -> Bool -> Int -> Args
+ Test.QuickCheck.Safe: Blind :: a -> Blind a
+ Test.QuickCheck.Safe: Confidence :: Integer -> Double -> Confidence
+ Test.QuickCheck.Safe: Discard :: Discard
+ Test.QuickCheck.Safe: Failure :: Int -> Int -> Int -> Int -> Int -> QCGen -> Int -> String -> Maybe AnException -> String -> [String] -> [String] -> Set String -> Result
+ Test.QuickCheck.Safe: Fixed :: a -> Fixed a
+ Test.QuickCheck.Safe: Fun :: (a :-> b, b, Shrunk) -> a -> b -> Fun a b
+ Test.QuickCheck.Safe: GaveUp :: Int -> Int -> !Map [String] Int -> !Map String Int -> !Map String Map String Int -> String -> Result
+ Test.QuickCheck.Safe: InfiniteList :: [a] -> InfiniteListInternalData a -> InfiniteList a
+ Test.QuickCheck.Safe: Large :: a -> Large a
+ Test.QuickCheck.Safe: NoExpectedFailure :: Int -> Int -> !Map [String] Int -> !Map String Int -> !Map String Map String Int -> String -> Result
+ Test.QuickCheck.Safe: NonEmpty :: [a] -> NonEmptyList a
+ Test.QuickCheck.Safe: NonNegative :: a -> NonNegative a
+ Test.QuickCheck.Safe: NonZero :: a -> NonZero a
+ Test.QuickCheck.Safe: Ordered :: [a] -> OrderedList a
+ Test.QuickCheck.Safe: Positive :: a -> Positive a
+ Test.QuickCheck.Safe: PrintableString :: String -> PrintableString
+ Test.QuickCheck.Safe: Shrink2 :: a -> Shrink2 a
+ Test.QuickCheck.Safe: Shrinking :: s -> a -> Shrinking s a
+ Test.QuickCheck.Safe: Small :: a -> Small a
+ Test.QuickCheck.Safe: Smart :: Int -> a -> Smart a
+ Test.QuickCheck.Safe: Sorted :: [a] -> SortedList a
+ Test.QuickCheck.Safe: Success :: Int -> Int -> !Map [String] Int -> !Map String Int -> !Map String Map String Int -> String -> Result
+ Test.QuickCheck.Safe: UnicodeString :: String -> UnicodeString
+ Test.QuickCheck.Safe: [certainty] :: Confidence -> Integer
+ Test.QuickCheck.Safe: [chatty] :: Args -> Bool
+ Test.QuickCheck.Safe: [classes] :: Result -> !Map String Int
+ Test.QuickCheck.Safe: [failingClasses] :: Result -> Set String
+ Test.QuickCheck.Safe: [failingLabels] :: Result -> [String]
+ Test.QuickCheck.Safe: [failingTestCase] :: Result -> [String]
+ Test.QuickCheck.Safe: [getASCIIString] :: ASCIIString -> String
+ Test.QuickCheck.Safe: [getBlind] :: Blind a -> a
+ Test.QuickCheck.Safe: [getFixed] :: Fixed a -> a
+ Test.QuickCheck.Safe: [getInfiniteList] :: InfiniteList a -> [a]
+ Test.QuickCheck.Safe: [getLarge] :: Large a -> a
+ Test.QuickCheck.Safe: [getNonEmpty] :: NonEmptyList a -> [a]
+ Test.QuickCheck.Safe: [getNonNegative] :: NonNegative a -> a
+ Test.QuickCheck.Safe: [getNonZero] :: NonZero a -> a
+ Test.QuickCheck.Safe: [getOrdered] :: OrderedList a -> [a]
+ Test.QuickCheck.Safe: [getPositive] :: Positive a -> a
+ Test.QuickCheck.Safe: [getPrintableString] :: PrintableString -> String
+ Test.QuickCheck.Safe: [getShrink2] :: Shrink2 a -> a
+ Test.QuickCheck.Safe: [getSmall] :: Small a -> a
+ Test.QuickCheck.Safe: [getSorted] :: SortedList a -> [a]
+ Test.QuickCheck.Safe: [getUnicodeString] :: UnicodeString -> String
+ Test.QuickCheck.Safe: [infiniteListInternalData] :: InfiniteList a -> InfiniteListInternalData a
+ Test.QuickCheck.Safe: [labels] :: Result -> !Map [String] Int
+ Test.QuickCheck.Safe: [maxDiscardRatio] :: Args -> Int
+ Test.QuickCheck.Safe: [maxShrinks] :: Args -> Int
+ Test.QuickCheck.Safe: [maxSize] :: Args -> Int
+ Test.QuickCheck.Safe: [maxSuccess] :: Args -> Int
+ Test.QuickCheck.Safe: [numDiscarded] :: Result -> Int
+ Test.QuickCheck.Safe: [numShrinkFinal] :: Result -> Int
+ Test.QuickCheck.Safe: [numShrinkTries] :: Result -> Int
+ Test.QuickCheck.Safe: [numShrinks] :: Result -> Int
+ Test.QuickCheck.Safe: [numTests] :: Result -> Int
+ Test.QuickCheck.Safe: [output] :: Result -> String
+ Test.QuickCheck.Safe: [reason] :: Result -> String
+ Test.QuickCheck.Safe: [replay] :: Args -> Maybe (QCGen, Int)
+ Test.QuickCheck.Safe: [tables] :: Result -> !Map String Map String Int
+ Test.QuickCheck.Safe: [theException] :: Result -> Maybe AnException
+ Test.QuickCheck.Safe: [tolerance] :: Confidence -> Double
+ Test.QuickCheck.Safe: [usedSeed] :: Result -> QCGen
+ Test.QuickCheck.Safe: [usedSize] :: Result -> Int
+ Test.QuickCheck.Safe: again :: Testable prop => prop -> Property
+ Test.QuickCheck.Safe: allProperties :: Q Exp
+ Test.QuickCheck.Safe: applyArbitrary2 :: (Arbitrary a, Arbitrary b) => a -> b -> r -> Gen r
+ Test.QuickCheck.Safe: applyArbitrary3 :: (Arbitrary a, Arbitrary b, Arbitrary c) => a -> b -> c -> r -> Gen r
+ Test.QuickCheck.Safe: applyArbitrary4 :: (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => a -> b -> c -> d -> r -> Gen r
+ Test.QuickCheck.Safe: applyFun :: () => Fun a b -> a -> b
+ Test.QuickCheck.Safe: applyFun2 :: () => Fun (a, b) c -> a -> b -> c
+ Test.QuickCheck.Safe: applyFun3 :: () => Fun (a, b, c) d -> a -> b -> c -> d
+ Test.QuickCheck.Safe: arbitrary :: Arbitrary a => Gen a
+ Test.QuickCheck.Safe: arbitrary1 :: (Arbitrary1 f, Arbitrary a) => Gen f a
+ Test.QuickCheck.Safe: arbitrary2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => Gen f a b
+ Test.QuickCheck.Safe: arbitraryASCIIChar :: Gen Char
+ Test.QuickCheck.Safe: arbitraryBoundedEnum :: (Bounded a, Enum a) => Gen a
+ Test.QuickCheck.Safe: arbitraryBoundedIntegral :: (Bounded a, Integral a) => Gen a
+ Test.QuickCheck.Safe: arbitraryBoundedRandom :: (Bounded a, Random a) => Gen a
+ Test.QuickCheck.Safe: arbitraryPrintableChar :: Gen Char
+ Test.QuickCheck.Safe: arbitrarySizedBoundedIntegral :: (Bounded a, Integral a) => Gen a
+ Test.QuickCheck.Safe: arbitrarySizedFractional :: Fractional a => Gen a
+ Test.QuickCheck.Safe: arbitrarySizedIntegral :: Integral a => Gen a
+ Test.QuickCheck.Safe: arbitrarySizedNatural :: Integral a => Gen a
+ Test.QuickCheck.Safe: arbitraryUnicodeChar :: Gen Char
+ Test.QuickCheck.Safe: checkCoverage :: Testable prop => prop -> Property
+ Test.QuickCheck.Safe: checkCoverageWith :: Testable prop => Confidence -> prop -> Property
+ Test.QuickCheck.Safe: choose :: Random a => (a, a) -> Gen a
+ Test.QuickCheck.Safe: class Arbitrary a
+ Test.QuickCheck.Safe: class Arbitrary1 (f :: * -> *)
+ Test.QuickCheck.Safe: class Arbitrary2 (f :: * -> * -> *)
+ Test.QuickCheck.Safe: class CoArbitrary a
+ Test.QuickCheck.Safe: class Function a
+ Test.QuickCheck.Safe: class ShrinkState s a
+ Test.QuickCheck.Safe: coarbitrary :: CoArbitrary a => a -> Gen b -> Gen b
+ Test.QuickCheck.Safe: coarbitraryEnum :: Enum a => a -> Gen b -> Gen b
+ Test.QuickCheck.Safe: coarbitraryIntegral :: Integral a => a -> Gen b -> Gen b
+ Test.QuickCheck.Safe: coarbitraryReal :: Real a => a -> Gen b -> Gen b
+ Test.QuickCheck.Safe: coarbitraryShow :: Show a => a -> Gen b -> Gen b
+ Test.QuickCheck.Safe: coverTable :: Testable prop => String -> [(String, Double)] -> prop -> Property
+ Test.QuickCheck.Safe: data Args
+ Test.QuickCheck.Safe: data Confidence
+ Test.QuickCheck.Safe: data Discard
+ Test.QuickCheck.Safe: data Fun a b
+ Test.QuickCheck.Safe: data Gen a
+ Test.QuickCheck.Safe: data InfiniteList a
+ Test.QuickCheck.Safe: data Result
+ Test.QuickCheck.Safe: data Shrinking s a
+ Test.QuickCheck.Safe: data Smart a
+ Test.QuickCheck.Safe: discard :: () => a
+ Test.QuickCheck.Safe: elements :: () => [a] -> Gen a
+ Test.QuickCheck.Safe: forAllBlind :: Testable prop => Gen a -> a -> prop -> Property
+ Test.QuickCheck.Safe: forAllProperties :: Q Exp
+ Test.QuickCheck.Safe: forAllShow :: Testable prop => Gen a -> a -> String -> a -> prop -> Property
+ Test.QuickCheck.Safe: forAllShrinkBlind :: Testable prop => Gen a -> a -> [a] -> a -> prop -> Property
+ Test.QuickCheck.Safe: forAllShrinkShow :: Testable prop => Gen a -> a -> [a] -> a -> String -> a -> prop -> Property
+ Test.QuickCheck.Safe: frequency :: () => [(Int, Gen a)] -> Gen a
+ Test.QuickCheck.Safe: function :: Function a => a -> b -> a :-> b
+ Test.QuickCheck.Safe: functionBoundedEnum :: (Eq a, Bounded a, Enum a) => a -> b -> a :-> b
+ Test.QuickCheck.Safe: functionIntegral :: Integral a => a -> b -> a :-> b
+ Test.QuickCheck.Safe: functionMap :: Function b => a -> b -> b -> a -> a -> c -> a :-> c
+ Test.QuickCheck.Safe: functionRealFrac :: RealFrac a => a -> b -> a :-> b
+ Test.QuickCheck.Safe: functionShow :: (Show a, Read a) => a -> c -> a :-> c
+ Test.QuickCheck.Safe: generate :: () => Gen a -> IO a
+ Test.QuickCheck.Safe: genericCoarbitrary :: (Generic a, GCoArbitrary Rep a) => a -> Gen b -> Gen b
+ Test.QuickCheck.Safe: genericShrink :: (Generic a, RecursivelyShrink Rep a, GSubterms Rep a a) => a -> [a]
+ Test.QuickCheck.Safe: getSize :: Gen Int
+ Test.QuickCheck.Safe: growingElements :: () => [a] -> Gen a
+ Test.QuickCheck.Safe: idempotentIOProperty :: Testable prop => IO prop -> Property
+ Test.QuickCheck.Safe: infiniteList :: Arbitrary a => Gen [a]
+ Test.QuickCheck.Safe: infiniteListOf :: () => Gen a -> Gen [a]
+ Test.QuickCheck.Safe: infix 4 =/=
+ Test.QuickCheck.Safe: ioProperty :: Testable prop => IO prop -> Property
+ Test.QuickCheck.Safe: isSuccess :: Result -> Bool
+ Test.QuickCheck.Safe: labelledExamples :: Testable prop => prop -> IO ()
+ Test.QuickCheck.Safe: labelledExamplesResult :: Testable prop => prop -> IO Result
+ Test.QuickCheck.Safe: labelledExamplesWith :: Testable prop => Args -> prop -> IO ()
+ Test.QuickCheck.Safe: labelledExamplesWithResult :: Testable prop => Args -> prop -> IO Result
+ Test.QuickCheck.Safe: liftArbitrary :: Arbitrary1 f => Gen a -> Gen f a
+ Test.QuickCheck.Safe: liftArbitrary2 :: Arbitrary2 f => Gen a -> Gen b -> Gen f a b
+ Test.QuickCheck.Safe: liftShrink :: Arbitrary1 f => a -> [a] -> f a -> [f a]
+ Test.QuickCheck.Safe: liftShrink2 :: Arbitrary2 f => a -> [a] -> b -> [b] -> f a b -> [f a b]
+ Test.QuickCheck.Safe: listOf :: () => Gen a -> Gen [a]
+ Test.QuickCheck.Safe: listOf1 :: () => Gen a -> Gen [a]
+ Test.QuickCheck.Safe: monomorphic :: Name -> ExpQ
+ Test.QuickCheck.Safe: newtype ASCIIString
+ Test.QuickCheck.Safe: newtype Blind a
+ Test.QuickCheck.Safe: newtype Fixed a
+ Test.QuickCheck.Safe: newtype Large a
+ Test.QuickCheck.Safe: newtype NonEmptyList a
+ Test.QuickCheck.Safe: newtype NonNegative a
+ Test.QuickCheck.Safe: newtype NonZero a
+ Test.QuickCheck.Safe: newtype OrderedList a
+ Test.QuickCheck.Safe: newtype Positive a
+ Test.QuickCheck.Safe: newtype PrintableString
+ Test.QuickCheck.Safe: newtype Shrink2 a
+ Test.QuickCheck.Safe: newtype Small a
+ Test.QuickCheck.Safe: newtype SortedList a
+ Test.QuickCheck.Safe: newtype UnicodeString
+ Test.QuickCheck.Safe: oneof :: () => [Gen a] -> Gen a
+ Test.QuickCheck.Safe: orderedList :: (Ord a, Arbitrary a) => Gen [a]
+ Test.QuickCheck.Safe: polyQuickCheck :: Name -> ExpQ
+ Test.QuickCheck.Safe: polyVerboseCheck :: Name -> ExpQ
+ Test.QuickCheck.Safe: quickCheckAll :: Q Exp
+ Test.QuickCheck.Safe: recursivelyShrink :: (Generic a, RecursivelyShrink Rep a) => a -> [a]
+ Test.QuickCheck.Safe: resize :: () => Int -> Gen a -> Gen a
+ Test.QuickCheck.Safe: sample :: Show a => Gen a -> IO ()
+ Test.QuickCheck.Safe: sample' :: () => Gen a -> IO [a]
+ Test.QuickCheck.Safe: scale :: () => Int -> Int -> Gen a -> Gen a
+ Test.QuickCheck.Safe: shrink :: Arbitrary a => a -> [a]
+ Test.QuickCheck.Safe: shrink1 :: (Arbitrary1 f, Arbitrary a) => f a -> [f a]
+ Test.QuickCheck.Safe: shrink2 :: (Arbitrary2 f, Arbitrary a, Arbitrary b) => f a b -> [f a b]
+ Test.QuickCheck.Safe: shrinkDecimal :: RealFrac a => a -> [a]
+ Test.QuickCheck.Safe: shrinkInit :: ShrinkState s a => a -> s
+ Test.QuickCheck.Safe: shrinkIntegral :: Integral a => a -> [a]
+ Test.QuickCheck.Safe: shrinkList :: () => a -> [a] -> [a] -> [[a]]
+ Test.QuickCheck.Safe: shrinkMap :: Arbitrary a => a -> b -> b -> a -> b -> [b]
+ Test.QuickCheck.Safe: shrinkMapBy :: () => a -> b -> b -> a -> a -> [a] -> b -> [b]
+ Test.QuickCheck.Safe: shrinkNothing :: () => a -> [a]
+ Test.QuickCheck.Safe: shrinkRealFrac :: RealFrac a => a -> [a]
+ Test.QuickCheck.Safe: shrinkState :: ShrinkState s a => a -> s -> [(a, s)]
+ Test.QuickCheck.Safe: shuffle :: () => [a] -> Gen [a]
+ Test.QuickCheck.Safe: sized :: () => Int -> Gen a -> Gen a
+ Test.QuickCheck.Safe: stdArgs :: Args
+ Test.QuickCheck.Safe: stdConfidence :: Confidence
+ Test.QuickCheck.Safe: sublistOf :: () => [a] -> Gen [a]
+ Test.QuickCheck.Safe: subterms :: (Generic a, GSubterms Rep a a) => a -> [a]
+ Test.QuickCheck.Safe: suchThat :: () => Gen a -> a -> Bool -> Gen a
+ Test.QuickCheck.Safe: suchThatMap :: () => Gen a -> a -> Maybe b -> Gen b
+ Test.QuickCheck.Safe: suchThatMaybe :: () => Gen a -> a -> Bool -> Gen Maybe a
+ Test.QuickCheck.Safe: tabulate :: Testable prop => String -> [String] -> prop -> Property
+ Test.QuickCheck.Safe: total :: NFData a => a -> Property
+ Test.QuickCheck.Safe: variant :: Integral n => n -> Gen a -> Gen a
+ Test.QuickCheck.Safe: vector :: Arbitrary a => Int -> Gen [a]
+ Test.QuickCheck.Safe: vectorOf :: () => Int -> Gen a -> Gen [a]
+ Test.QuickCheck.Safe: verboseCheck :: Testable prop => prop -> IO ()
+ Test.QuickCheck.Safe: verboseCheckAll :: Q Exp
+ Test.QuickCheck.Safe: verboseCheckResult :: Testable prop => prop -> IO Result
+ Test.QuickCheck.Safe: verboseCheckWith :: Testable prop => Args -> prop -> IO ()
+ Test.QuickCheck.Safe: verboseCheckWithResult :: Testable prop => Args -> prop -> IO Result
+ Test.QuickCheck.Safe: verboseShrinking :: Testable prop => prop -> Property
+ Test.QuickCheck.Safe: whenFail :: Testable prop => IO () -> prop -> Property
+ Test.QuickCheck.Safe: whenFail' :: Testable prop => IO () -> prop -> Property
+ Test.QuickCheck.Safe: withMaxSuccess :: Testable prop => Int -> prop -> Property
- Test.QuickCheck.Safe.Trusted: data QCGen :: *
+ Test.QuickCheck.Safe.Trusted: data QCGen

Files

Changelog view
@@ -1,3 +1,6 @@+QuickCheck-safe 0.1.0.5+	* compatibility with QuickCheck 2.12+ QuickCheck-safe 0.1.0.4 	* compatibility with QuickCheck 2.11 
QuickCheck-safe.cabal view
@@ -1,5 +1,5 @@ name:                QuickCheck-safe-version:             0.1.0.4+version:             0.1.0.5 synopsis:            Safe reimplementation of QuickCheck's core description:   QuickCheck-safe reimplements the quickCheck functionality with a pure@@ -33,7 +33,8 @@ library   hs-source-dirs:    src   build-depends:-    QuickCheck >= 2.7.3 && < 2.12,+    QuickCheck >= 2.7.3 && < 2.13,+    containers >= 0.5 && < 0.7,     base >= 4.6 && < 5   exposed-modules:     Test.QuickCheck.Safe
src/Test/QuickCheck/Safe.hs view
@@ -33,6 +33,8 @@     quickCheck, quickCheckResult, quickCheckWith, quickCheckWithResult) import Test.QuickCheck.Gen (Gen(..)) import Control.Monad+import qualified Data.Set as S+import qualified Data.Map as M  -- STestable and SProperty are simplified versions of Testable/Property class STestable prop where@@ -181,13 +183,27 @@         | pass >= maxSuccess args =             return Success{                 numTests = pass,+#if MIN_VERSION_QuickCheck(2,12,0)+                numDiscarded = disc,+                labels = M.empty,+                classes = M.empty,+                tables = M.empty,+#else                 labels = [],+#endif                 output = "+++ OK, passed " ++ show pass ++ " tests.\n"              }         | disc > (maxDiscardRatio args - 1) * maxSuccess args =             return GaveUp{                 numTests = pass,+#if MIN_VERSION_QuickCheck(2,12,0)+                numDiscarded = disc,+                labels = M.empty,+                classes = M.empty,+                tables = M.empty,+#else                 labels = [],+#endif                 output = "*** Gave up! Passed only " ++ show pass ++ " tests.\n"              }         | otherwise = do@@ -196,10 +212,10 @@             case res of                 SOk -> runTests (pass + 1) disc sizes                 SDiscard -> runTests pass (disc + 1) sizes-                SFail{} -> return $ deflate pass 0 0 0 seed size res+                SFail{} -> return $ deflate pass disc 0 0 0 seed size res -    deflate :: Int -> Int -> Int -> Int -> QCGen -> Int -> SResult -> Result-    deflate pass !shr !shrT !shrF seed size res@SFail{ sSmaller = [] } =+    deflate :: Int -> Int -> Int -> Int -> Int -> QCGen -> Int -> SResult -> Result+    deflate pass disc !shr !shrT !shrF seed size res@SFail{ sSmaller = [] } =         Failure{             numTests = pass,             numShrinks = shr,@@ -209,10 +225,16 @@             usedSize = size,             reason = reason,             theException = sException res,-            labels = map (\x -> (x, 0)) (sLabels res), #if MIN_VERSION_QuickCheck(2,10,0)             failingTestCase = sLabels res, #endif+#if !MIN_VERSION_QuickCheck(2,12,0)+            labels = map (\x -> (x, 0)) (sLabels res),+#else+            numDiscarded = disc,+            failingLabels = sLabels res,+            failingClasses = S.empty,+#endif             output = "*** Failed! " ++ reason ++                   " (after " ++ count (pass + 1) "test" ++                   (if shr > 0 then " and " ++ count shr "shrink" else "") ++@@ -222,10 +244,10 @@         count i w = show i ++ " " ++ w ++ ['s' | i /= 1]         reason = maybe "Falsifiable" (\e -> "Exception: '" ++ show e ++ "'") $             sException res-    deflate pass shr shrT shrF seed size res@SFail{ sSmaller = res' : rs } =+    deflate pass disc shr shrT shrF seed size res@SFail{ sSmaller = res' : rs } =         case res' of-            SFail{} -> deflate pass (shr + 1) (shrT + shrF) 0 seed size res'-            _ -> deflate pass shr shrT (shrF + 1) seed size res{ sSmaller = rs }+            SFail{} -> deflate pass disc (shr + 1) (shrT + shrF) 0 seed size res'+            _ -> deflate pass disc shr shrT (shrF + 1) seed size res{ sSmaller = rs }      sizes :: [Int]     sizes = cycle [0..maxSize args]