| Copyright | ⓒ Anselm Schüler 2022 |
|---|---|
| License | MIT |
| Maintainer | Anselm Schüler <mail@anselmschueler.com> |
| Stability | stable |
| Portability | Portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Distribution.TestSuite.QuickCheck
Description
This module allows you to easily make Cabal tests for the detailed-0.9 interface.
It sets sensible option declarations for the tests.
This module re-uses record names from TestSuite and QuickCheck.
It is recommended that you enable the DisambiguateRecordFields extension in GHC and/or import the module qualified.
For basic tests, you don’t need to import TestSuite.
Synopsis
- getPropertyTest :: Testable prop => PropertyTest prop -> Test
- getPropertyTestWith :: Testable prop => TestArgs -> PropertyTest prop -> Test
- getPropertyTestUsing :: Testable prop => PropertyTest (TestArgs -> prop) -> Test
- getPropertyTestWithUsing :: Testable prop => TestArgs -> PropertyTest (TestArgs -> prop) -> Test
- data PropertyTest prop = PropertyTest {}
- data TestArgs = TestArgs {
- verbosity :: Verbosity
- verboseShrinking :: Bool
- maxDiscardRatio :: Int
- noShrinking :: Bool
- maxShrinks :: Int
- maxSuccess :: Int
- maxSize :: Int
- sizeScale :: Int
- data Verbosity
- argsToTestArgs :: Args -> TestArgs
- testArgsToArgs :: TestArgs -> Args
- stdTestArgs :: TestArgs
Create tests
getPropertyTest :: Testable prop => PropertyTest prop -> Test Source #
Get a Cabal Test from a PropertyTest
Arguments
| :: Testable prop | |
| => TestArgs | The arguments for the test |
| -> PropertyTest prop | |
| -> Test |
Get a Cabal Test from a PropertyTest with custom TestArgs
Arguments
| :: Testable prop | |
| => PropertyTest (TestArgs -> prop) | |
| -> Test |
Get a Cabal Test from a PropertyTest that takes the test arguments and returns a Testable value
getPropertyTestWithUsing Source #
Arguments
| :: Testable prop | |
| => TestArgs | The arguments for the test |
| -> PropertyTest (TestArgs -> prop) | |
| -> Test |
Get a Cabal Test with custom TestArgs from a PropertyTest that takes the test arguments and returns a testable value
Argument data types
data PropertyTest prop Source #
Property test declaration with metadata
Arguments for altering property test behaviour.
These can be altered in the final Cabal Test using setOption.
Constructors
| TestArgs | |
Fields
| |
Datatype for setting the verbosity of tests
Instances
| Bounded Verbosity Source # | |
| Enum Verbosity Source # | |
Defined in Distribution.TestSuite.QuickCheck Methods succ :: Verbosity -> Verbosity # pred :: Verbosity -> Verbosity # fromEnum :: Verbosity -> Int # enumFrom :: Verbosity -> [Verbosity] # enumFromThen :: Verbosity -> Verbosity -> [Verbosity] # enumFromTo :: Verbosity -> Verbosity -> [Verbosity] # enumFromThenTo :: Verbosity -> Verbosity -> Verbosity -> [Verbosity] # | |
| Eq Verbosity Source # | |
| Ord Verbosity Source # | |
Defined in Distribution.TestSuite.QuickCheck | |
| Read Verbosity Source # | |
| Show Verbosity Source # | |
Functions for using arguments
argsToTestArgs :: Args -> TestArgs Source #
testArgsToArgs :: TestArgs -> Args Source #
Recover arguments passed to quickCheck from a TestArgs
stdTestArgs :: TestArgs Source #
Default arguments for property tests