QuickCheck-2.8: Automatic testing of Haskell programs

Safe HaskellSafe
LanguageHaskell98

Test.QuickCheck.Test

Contents

Description

The main test loop.

Synopsis

Running tests

data Args Source

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 Source

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

InsufficientCoverage

The tests passed but a use of cover had insufficient coverage

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 Source

Check if the test run result was a success

stdArgs :: Args Source

The default test arguments

quickCheck :: Testable prop => prop -> IO () Source

Tests a property and prints the results to stdout.

quickCheckWith :: Testable prop => Args -> prop -> IO () Source

Tests a property, using test arguments, and prints the results to stdout.

quickCheckResult :: Testable prop => prop -> IO Result Source

Tests a property, produces a test result, and prints the results to stdout.

quickCheckWithResult :: Testable prop => Args -> prop -> IO Result Source

Tests a property, using test arguments, produces a test result, and prints the results to stdout.

verboseCheck :: Testable prop => prop -> IO () Source

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 () Source

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 Source

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 Source

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 Source