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.Test

The main test loop.

  • 2 types
  • 47 values

Running tests

49 declarations
datadata Args
#

Args specifies arguments to the QuickCheck driver

Constructors

  • Args
    • replay :: 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 :: 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 :: Int

      Maximum number of discarded tests per successful test before giving up

    • maxSize :: Int

      Size to use for the biggest test cases

    • chatty :: Bool

      Whether to print anything

    • maxShrinks :: Int

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

Instances2Read, Show
  • Read ArgsDefined in QuickCheck-2.15.0.1 · Test.QuickCheck.Test
  • Show ArgsDefined in QuickCheck-2.15.0.1 · Test.QuickCheck.Test
datadata Result
#

Result represents the test result

Constructors

Instances1Show
  • Show ResultDefined in QuickCheck-2.15.0.1 · Test.QuickCheck.Test
valuequickCheck :: 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 withMaxSuccess.

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

valuewithState :: Args -> (State -> IO a) -> IO a
#
valuecomputeSize :: State -> Int
#
valueclamp :: Ord a => a -> (a, a) -> a
#
valueverboseCheck :: 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.

valueverboseCheckWith :: 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.

valueverboseCheckResult :: 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.

valueverboseCheckWithResult :: 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.

valuefinishedSuccessfully :: State -> Bool
#
valuefinishedInsufficientCoverage :: State -> Bool
#
valuetooManyDiscards :: State -> Bool
#
valuecheckingCoverage :: State -> Bool
#
valuetimeToCheckCoverage :: State -> Bool
#
valuecoverageKnownSufficient :: State -> Bool
#
valuecoverageKnownInsufficient :: State -> Bool
#
valueshowTestCount :: State -> String
#
valuefailureSummary :: State -> Result -> String
#
valuefailureReason :: State -> Result -> [String]
#
valuefailureSummaryAndReason :: State -> Result -> (String, [String])
#
valuesuccess :: State -> IO ()
#
valuefoundFailure
  1. :: State
  2. -> Result
  3. -> [Rose Result]
  4. -> IO (Int, Int, Int, Result)
#
valuelocalMin :: State -> Result -> [Rose Result] -> IO (Int, Int, Int, Result)
#
valuelocalMin' :: State -> Result -> [Rose Result] -> IO (Int, Int, Int, Result)
#
valuelocalMinFound :: State -> Result -> IO (Int, Int, Int, Result)
#
valuecallbackPostTest :: State -> Result -> IO Result
#
valuecallbackPostFinalFailure :: State -> Result -> IO ()
#