QuickCheck-2.7.6: Automatic testing of Haskell programs

Safe HaskellSafe

Test.QuickCheck.Test

Contents

Description

The main test loop.

Synopsis

Running tests

data Args

Args specifies arguments to the QuickCheck driver

Constructors

Args 

Fields

replay :: Maybe (QCGen, Int)

Should we replay a previous test?

maxSuccess :: Int

Maximum number of successful tests before succeeding

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

Instances

data Result

Result represents the test result

Constructors

Success

A successful test run

Fields

numTests :: Int

Number of tests performed

labels :: [(String, Int)]

Labels and frequencies found during all successful tests

output :: String

Printed output

GaveUp

Given up

Fields

numTests :: Int

Number of tests performed

labels :: [(String, Int)]

Labels and frequencies found during all successful tests

output :: String

Printed output

Failure

A failed test run

Fields

numTests :: Int

Number of tests performed

numShrinks :: Int

Number of successful shrinking steps performed

numShrinkTries :: Int

Number of unsuccessful shrinking steps performed

numShrinkFinal :: Int

Number of unsuccessful shrinking steps performed since last successful shrink

usedSeed :: QCGen

What seed was used

usedSize :: Int

What was the test size

reason :: String

Why did the property fail

theException :: Maybe AnException

The exception the property threw, if any

labels :: [(String, Int)]

Labels and frequencies found during all successful tests

output :: String

Printed output

NoExpectedFailure

A property that should have failed did not

Fields

numTests :: Int

Number of tests performed

labels :: [(String, Int)]

Labels and frequencies found during all successful tests

output :: String

Printed output

Instances

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.

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.

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.

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.

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.

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.

test :: State -> (QCGen -> Int -> Prop) -> IO Result

giveUp :: State -> (QCGen -> Int -> Prop) -> IO Result

runATest :: State -> (QCGen -> Int -> Prop) -> IO Result

summary :: State -> [(String, Int)]

success :: State -> IO ()

safely :: State -> IO () -> IO ()