HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Running tests

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.18.0.0 · Test.QuickCheck.Test
  • Show ArgsDefined in QuickCheck-2.18.0.0 · Test.QuickCheck.Test
datadata Result

Result represents the test result

Constructors

Instances1Show
  • Show ResultDefined in QuickCheck-2.18.0.0 · Test.QuickCheck.Test
valuequickCheck :: Testable prop => prop -> IO ()

Tests a property and prints the results to System.IO.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.

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 System.IO.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 System.IO.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 System.IO.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 System.IO.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
#
valuefailCoverage :: State -> IO Result
#
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 ()
#