Safe Haskell | Safe |
---|---|
Language | Haskell98 |
The main test loop.
Synopsis
- data Args = Args {
- replay :: Maybe (QCGen, Int)
- maxSuccess :: Int
- maxDiscardRatio :: Int
- maxSize :: Int
- chatty :: Bool
- maxShrinks :: Int
- data Result
- = Success { }
- | GaveUp { }
- | Failure {
- numTests :: Int
- numShrinks :: Int
- numShrinkTries :: Int
- numShrinkFinal :: Int
- usedSeed :: QCGen
- usedSize :: Int
- reason :: String
- theException :: Maybe AnException
- labels :: [(String, Double)]
- output :: String
- failingTestCase :: [String]
- | NoExpectedFailure { }
- | InsufficientCoverage { }
- isSuccess :: Result -> Bool
- stdArgs :: Args
- quickCheck :: Testable prop => prop -> IO ()
- quickCheckWith :: Testable prop => Args -> prop -> IO ()
- quickCheckResult :: Testable prop => prop -> IO Result
- quickCheckWithResult :: Testable prop => Args -> prop -> IO Result
- verboseCheck :: Testable prop => prop -> IO ()
- verboseCheckWith :: Testable prop => Args -> prop -> IO ()
- verboseCheckResult :: Testable prop => prop -> IO Result
- verboseCheckWithResult :: Testable prop => Args -> prop -> IO Result
- test :: State -> (QCGen -> Int -> Prop) -> IO Result
- doneTesting :: State -> (QCGen -> Int -> Prop) -> IO Result
- giveUp :: State -> (QCGen -> Int -> Prop) -> IO Result
- runATest :: State -> (QCGen -> Int -> Prop) -> IO Result
- failureSummary :: State -> Result -> String
- failureReason :: State -> Result -> [String]
- failureSummaryAndReason :: State -> Result -> (String, [String])
- summary :: State -> [(String, Double)]
- success :: State -> IO ()
- formatLabel :: Int -> Bool -> (String, Double) -> String
- labelCount :: String -> State -> Int
- percentage :: Integral a => State -> a -> Double
- insufficientlyCovered :: State -> [(String, Int, Double)]
- foundFailure :: State -> Result -> [Rose Result] -> IO (Int, Int, Int, Result)
- localMin :: State -> Result -> Result -> [Rose Result] -> IO (Int, Int, Int, Result)
- localMin' :: State -> Result -> [Rose Result] -> IO (Int, Int, Int, Result)
- localMinFound :: State -> Result -> IO (Int, Int, Int, Result)
- callbackPostTest :: State -> Result -> IO Result
- callbackPostFinalFailure :: State -> Result -> IO ()
Running tests
Args specifies arguments to the QuickCheck driver
Args | |
|
Result represents the test result
Success | A successful test run |
GaveUp | Given up |
Failure | A failed test run |
| |
NoExpectedFailure | A property that should have failed did not |
InsufficientCoverage | The tests passed but a use of |
quickCheck :: Testable prop => prop -> IO () Source #
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
.
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
.