Community
Modules 18

Test.QuickCheck.Test

The main test loop.

5 generation diagnostics
  • unattached documentation comment at 95:3
  • unattached documentation comment at 110:3
  • unattached documentation comment at 120:3
  • unattached documentation comment at 151:3
  • unattached documentation comment at 62:1

data Args

Args specifies arguments to the QuickCheck driver

Args :: Maybe (QCGen, Int) -> Int -> Int -> Int -> Bool -> Int -> Args

replay :: Args -> Maybe (QCGen, Int)

Should we replay a previous test? Note: saving a seed from one version of QuickCheck and replaying it in another is not supported. If you want to store a test case permanently you should save the test case itself.

maxSuccess :: Args -> Int

Maximum number of successful tests before succeeding. Testing stops at the first failure. If all tests are passing and you want to run more tests, increase this number.

maxDiscardRatio :: Args -> Int

Maximum number of discarded tests per successful test before giving up

maxSize :: Args -> Int

Size to use for the biggest test cases

chatty :: Args -> Bool

Whether to print anything

maxShrinks :: Args -> Int

Maximum number of shrinks to do before giving up. Setting this to zero turns shrinking off.

data Result

Result represents the test result

Success :: Int -> Int -> (Map [String] Int) -> (Map String Int) -> (Map String (Map String Int)) -> String -> Result

numTests :: Result -> Int

Number of tests performed

labels :: Result -> (Map [String] Int)

The number of test cases having each combination of labels (see label)

classes :: Result -> (Map String Int)

The number of test cases having each class (see classify)

tables :: Result -> (Map String (Map String Int))

Data collected by tabulate

output :: Result -> String

Printed output

GaveUp :: Int -> Int -> (Map [String] Int) -> (Map String Int) -> (Map String (Map String Int)) -> String -> Result

labels :: Result -> (Map [String] Int)

classes :: Result -> (Map String Int)

tables :: Result -> (Map String (Map String Int))

Failure :: Int -> Int -> Int -> Int -> Int -> QCGen -> Int -> String -> Maybe AnException -> String -> [String] -> [String] -> Set String -> [Witness] -> Result

numShrinks :: Result -> Int

Number of successful shrinking steps performed

numShrinkTries :: Result -> Int

Number of unsuccessful shrinking steps performed

numShrinkFinal :: Result -> Int

Number of unsuccessful shrinking steps performed since last successful shrink

usedSeed :: Result -> QCGen

What seed was used

usedSize :: Result -> Int

What was the test size

reason :: Result -> String

Why did the property fail

theException :: Result -> Maybe AnException

The exception the property threw, if any

failingTestCase :: Result -> [String]

The test case which provoked the failure

failingLabels :: Result -> [String]

The test case's labels (see label)

failingClasses :: Result -> Set String

The test case's classes (see classify)

witnesses :: Result -> [Witness]

The existentially quantified witnesses provided by witness

NoExpectedFailure :: Int -> Int -> (Map [String] Int) -> (Map String Int) -> (Map String (Map String Int)) -> String -> Result

labels :: Result -> (Map [String] Int)

classes :: Result -> (Map String Int)

tables :: Result -> (Map String (Map String Int))

isSuccess :: Result -> Bool

Check if the test run result was a success

stdArgs :: Args

The default test arguments

quickCheck :: Testable prop => prop -> IO ()

Tests a property and prints the results to stdout.

By default up to 100 tests are performed, which may not be enough to find all bugs. To run more tests, use withNumTests.

If you want to get the counterexample as a Haskell value, rather than just printing it, try the quickcheck-with-counterexamples package.

quickCheckWith :: Testable prop => Args -> prop -> IO ()

Tests a property, using test arguments, and prints the results to stdout.

quickCheckResult :: Testable prop => prop -> IO Result

Tests a property, produces a test result, and prints the results to stdout.

quickCheckWithResult :: Testable prop => Args -> prop -> IO Result

Tests a property, using test arguments, produces a test result, and prints the results to stdout.

recheck :: Testable prop => Result -> prop -> IO ()

Re-run a property with the seed and size that failed in a run of quickCheckResult.

withState :: Args -> (State -> IO a) -> IO a

clamp :: Ord a => a -> (a, a) -> a

verboseCheck :: Testable prop => prop -> IO ()

Tests a property and prints the results and all test cases generated to stdout. This is just a convenience function that means the same as quickCheck . verbose.

Note: for technical reasons, the test case is printed out after the property is tested. To debug a property that goes into an infinite loop, use within to add a timeout instead.

verboseCheckWith :: Testable prop => Args -> prop -> IO ()

Tests a property, using test arguments, and prints the results and all test cases generated to stdout. This is just a convenience function that combines quickCheckWith and verbose.

Note: for technical reasons, the test case is printed out after the property is tested. To debug a property that goes into an infinite loop, use within to add a timeout instead.

verboseCheckResult :: Testable prop => prop -> IO Result

Tests a property, produces a test result, and prints the results and all test cases generated to stdout. This is just a convenience function that combines quickCheckResult and verbose.

Note: for technical reasons, the test case is printed out after the property is tested. To debug a property that goes into an infinite loop, use within to add a timeout instead.

verboseCheckWithResult :: Testable prop => Args -> prop -> IO Result

Tests a property, using test arguments, produces a test result, and prints the results and all test cases generated to stdout. This is just a convenience function that combines quickCheckWithResult and verbose.

Note: for technical reasons, the test case is printed out after the property is tested. To debug a property that goes into an infinite loop, use within to add a timeout instead.

test :: State -> Property -> IO Result

giveUp :: State -> IO Result

runATest :: State -> Property -> IO Result

showTable :: Int -> Maybe String -> Map String Int -> [String]

foundFailure :: State -> P.Result -> [Rose P.Result] -> IO (Int, Int, Int, P.Result)

localMin :: State -> P.Result -> [Rose P.Result] -> IO (Int, Int, Int, P.Result)

localMin' :: State -> P.Result -> [Rose P.Result] -> IO (Int, Int, Int, P.Result)

localMinFound :: State -> P.Result -> IO (Int, Int, Int, P.Result)

wilson :: Integer -> Integer -> Double -> Double

wilsonLow :: Integer -> Integer -> Double -> Double

wilsonHigh :: Integer -> Integer -> Double -> Double

allCoverage :: State -> [(Maybe String, String, Int, Int, Double)]

Instances

4
  • instance Show Args
  • instance Read Args
  • instance Typeable Args
  • instance Show Result
Build record and source files

Community contribution. The service has not verified this documentation. The generator reported 30 diagnostics.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-aa6debbd-web-3

Metadata snapshot: f17ab6aeb2a7b6daf9fba7614097e138beeef85fa92c3fb7fdfed9ed0e49728c

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.