Copyright | ⓒ Anselm Schüler 2022 |
---|---|
License | MIT |
Maintainer | Anselm Schüler <mail@anselmschueler.com> |
Stability | stable |
Portability | Portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module allows you to easily make Cabal tests for the detailed-0.9
interface. ([docs](https:/cabal.readthedocs.ioen3.6cabal-package.html#example-package-using-detailed-0-9-interface))
It sets sensible option declarations for the tests.
This module re-uses record names from Distribution.TestSuite and Test.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 Distribution.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
- getPropertyTests :: Testable prop => [PropertyTest prop] -> [Test]
- propertyTestGroup :: Testable prop => String -> [PropertyTest 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
:: Testable prop | |
=> TestArgs | The arguments for the test |
-> PropertyTest prop | |
-> Test |
Get a Cabal Test
from a PropertyTest
with custom TestArgs
:: 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 #
:: 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
getPropertyTests :: Testable prop => [PropertyTest prop] -> [Test] Source #
Get a list of Test
s from a list of PropertyTest
s
propertyTestGroup :: Testable prop => String -> [PropertyTest prop] -> Test Source #
Get a named test group from a list of PropertyTest
s. These are assumed to be able to run in parallel. See testGroup
and Group
.
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
.
TestArgs | |
|
Datatype for setting the verbosity of tests
Instances
Bounded Verbosity Source # | |
Enum Verbosity Source # | |
Defined in Distribution.TestSuite.QuickCheck 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] # | |
Read Verbosity Source # | |
Show Verbosity Source # | |
Eq Verbosity Source # | |
Ord Verbosity Source # | |
Defined in Distribution.TestSuite.QuickCheck |
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