Community
Modules 18

Test.QuickCheck.State

QuickCheck's internal state. Internal QuickCheck module.

data State

State represents QuickCheck's internal state while testing a property. The state is made visible to callback functions.

MkState :: Terminal -> Int -> Int -> Maybe Confidence -> Int -> Maybe Int -> Int -> Int -> Int -> Int -> (Map [String] Int) -> (Map String Int) -> (Map String (Map String Int)) -> (Map (Maybe String, String) Double) -> Bool -> QCGen -> Int -> Int -> Int -> State

terminal :: State -> Terminal

the current terminal

maxSuccessTests :: State -> Int

maximum number of successful tests needed

maxDiscardedRatio :: State -> Int

maximum number of discarded tests per successful test

coverageConfidence :: State -> Maybe Confidence

how to compute the size of test cases from #tests and #discarded tests

numSuccessTests :: State -> Int

the current number of tests that have succeeded

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

counts for each combination of labels (label/collect)

classes :: State -> (Map String Int)

counts for each class of test case (classify/cover)

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

tables collected using tabulate

requiredCoverage :: State -> (Map (Maybe String, String) Double)

coverage requirements

expected :: State -> Bool

indicates the expected result of the property

randomSeed :: State -> QCGen

the current random seed

numTryShrinks :: State -> Int

number of failed shrinking steps since the last successful shrink

data Confidence

The statistical parameters used by checkCoverage.

Confidence :: Integer -> Double -> Confidence

certainty :: Confidence -> Integer

How certain checkCoverage must be before the property fails. If the coverage requirement is met, and the certainty parameter is n, then you should get a false positive at most one in n runs of QuickCheck. The default value is 10^9.

Lower values will speed up checkCoverage at the cost of false positives.

If you are using checkCoverage as part of a test suite, you should be careful not to set certainty too low. If you want, say, a 1% chance of a false positive during a project's lifetime, then certainty should be set to at least 100 * m * n, where m@ is the number of uses of cover in the test suite, and n is the number of times you expect the test suite to be run during the project's lifetime. The default value is chosen to be big enough for most projects.

tolerance :: Confidence -> Double

For statistical reasons, checkCoverage will not reject coverage levels that are only slightly below the required levels. If the required level is p then an actual level of tolerance * p will be accepted. The default value is 0.9.

Lower values will speed up checkCoverage at the cost of not detecting minor coverage violations.

data TestProgress

TestProgress, contains information that might be interesting to external libraries, e.g. Tasty. From this it is possible to install your own callbacks that reports e.g. progress.

TestProgress :: Int -> Int -> Int -> Int -> Int -> Int -> TestProgress

currentPassed :: TestProgress -> Int

Number of tests passed so far

maxTests :: TestProgress -> Int

Number of tests to execute

currentShrinks :: TestProgress -> Int

Number of successful shrinking steps

currentFailedShrinks :: TestProgress -> Int

Number of failed shrinking steps since last successful one

Instances

2
  • instance Show Confidence
  • instance Show TestProgress
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.