cabal-detailed-quickcheck-0.1.1.5: QuickCheck for Cabal tests
Copyrightⓒ Anselm Schüler 2022
LicenseMIT
MaintainerAnselm Schüler <mail@anselmschueler.com>
Stabilitystable
PortabilityPortable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.TestSuite.QuickCheck

Description

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

Create tests

getPropertyTest :: Testable prop => PropertyTest prop -> Test Source #

Get a Cabal Test from a PropertyTest

getPropertyTestWith Source #

Arguments

:: Testable prop 
=> TestArgs

The arguments for the test

-> PropertyTest prop 
-> Test 

Get a Cabal Test from a PropertyTest with custom TestArgs

getPropertyTestUsing Source #

Arguments

:: Testable prop 
=> PropertyTest (TestArgs -> prop)

A property test whose property takes a TestArgs argument

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

A property test whose property takes a TestArgs argument

-> 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 Tests from a list of PropertyTests

propertyTestGroup :: Testable prop => String -> [PropertyTest prop] -> Test Source #

Get a named test group from a list of PropertyTests. 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

Constructors

PropertyTest 

Fields

  • name :: String

    Name of the test, for Cabal. See See Cabal’s name.

  • tags :: [String]

    Tags of the test, for Cabal. See Cabal’s tags.

  • property :: prop

    Property to check. This should usually be or return an instance of Testable.

data TestArgs Source #

Arguments for altering property test behaviour. These can be altered in the final Cabal Test using setOption.

Constructors

TestArgs 

Fields

data Verbosity Source #

Datatype for setting the verbosity of tests

Constructors

Silent

QuickCheck prints nothing. This sets chatty = False.

Chatty

Print basic statistics. This sets chatty = True.

Verbose

Print every test case. This applies verbose.

Instances

Instances details
Bounded Verbosity Source # 
Instance details

Defined in Distribution.TestSuite.QuickCheck

Enum Verbosity Source # 
Instance details

Defined in Distribution.TestSuite.QuickCheck

Read Verbosity Source # 
Instance details

Defined in Distribution.TestSuite.QuickCheck

Show Verbosity Source # 
Instance details

Defined in Distribution.TestSuite.QuickCheck

Eq Verbosity Source # 
Instance details

Defined in Distribution.TestSuite.QuickCheck

Ord Verbosity Source #

Silent < Chatty < Verbose

Instance details

Defined in Distribution.TestSuite.QuickCheck

Functions for using arguments

argsToTestArgs :: Args -> TestArgs Source #

Transform a QuickCheck Args value to a TestArgs value, defaulting all missing properties

testArgsToArgs :: TestArgs -> Args Source #

Recover arguments passed to quickCheck from a TestArgs

stdTestArgs :: TestArgs Source #

Default arguments for property tests