HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleQuickCheck-2.15.0.1Haskell2010

Test.QuickCheck.State

QuickCheck's internal state. Internal QuickCheck module.

  • 2 types
datadata State
#

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

Constructors

  • MkState
    • terminal :: Terminal

      the current terminal

    • maxSuccessTests :: Int

      maximum number of successful tests needed

    • maxDiscardedRatio :: Int

      maximum number of discarded tests per successful test

    • coverageConfidence :: Maybe Confidence

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

    • numTotMaxShrinks :: !Int

      How many shrinks to try before giving up

    • replayStartSize :: Maybe Int

      Size to start at when replaying

    • maxTestSize :: !Int

      Maximum size of test

    • numSuccessTests :: !Int

      the current number of tests that have succeeded

    • numDiscardedTests :: !Int

      the current number of discarded tests

    • numRecentlyDiscardedTests :: !Int

      the number of discarded tests since the last successful test

    • labels :: !Map [String] Int

      counts for each combination of labels (label/collect)

    • classes :: !Map String Int

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

    • tables :: !Map String (Map String Int)

      tables collected using tabulate

    • requiredCoverage :: !Map (Maybe String, String) Double

      coverage requirements

    • expected :: !Bool

      indicates the expected result of the property

    • randomSeed :: !QCGen

      the current random seed

    • numSuccessShrinks :: !Int

      number of successful shrinking steps so far

    • numTryShrinks :: !Int

      number of failed shrinking steps since the last successful shrink

    • numTotTryShrinks :: !Int

      total number of failed shrinking steps

datadata Confidence
#

The statistical parameters used by checkCoverage.

Constructors

  • Confidence
    • certainty :: 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 :: 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.

Instances1Show
  • Show ConfidenceDefined in QuickCheck-2.15.0.1 · Test.QuickCheck.State