Modules 18
Test.QuickCheck.Features
prop_noNewFeatures :: Testable prop => Set String -> prop -> Property
labelledExamples :: Testable prop => prop -> IO ()
Given a property, which must use label, collect, classify or cover
to associate labels with test cases, find an example test case for each possible label.
The example test cases are minimised using shrinking.
For example, suppose we test and record the number
of times that delete x xsx occurs in xs:
prop_delete :: Int -> [Int] -> Property
prop_delete x xs =
classify (count x xs == 0) "count x xs == 0" $
classify (count x xs == 1) "count x xs == 1" $
classify (count x xs >= 2) "count x xs >= 2" $
counterexample (show (delete x xs)) $
count x (delete x xs) == max 0 (count x xs-1)
where count x xs = length (filter (== x) xs)labelledExamples generates three example test cases, one for each label:
labelledExamplesWith :: Testable prop => Args -> prop -> IO ()
A variant of labelledExamples that takes test arguments.
labelledExamplesResult :: Testable prop => prop -> IO Result
A variant of labelledExamples that returns a result.
labelledExamplesWithResult :: Testable prop => Args -> prop -> IO Result
A variant of labelledExamples that takes test arguments and returns a result.
Build record and source files
Community contribution. The service has not verified this documentation. The generator reported 30 diagnostics.
Target: Linux on x86-64. Some inferred types and resolved links are not available.
Generator: aihc-haddock-aa6debbd-web-3
Metadata snapshot: f17ab6aeb2a7b6daf9fba7614097e138beeef85fa92c3fb7fdfed9ed0e49728c
Open the dependency plan · Download the documentation model
- QuickCheck-2.18.0.0 · Cabal revision 0 · Cabal file · Source archive
- aihc-base-4.21.2.0 · Core library · Cabal file
- aihc-internal-9.1204.0 · Core library · Cabal file
- aihc-prim-0.13.0 · Core library · Cabal file
- aihc-rts-1.0.2 · Core library · Cabal file
- aihc-template-haskell-2.23.0.0 · Core library · Cabal file
- array-0.5.8.0 · Cabal revision 2 · Cabal file · Source archive
- bytestring-0.12.2.0 · Cabal revision 1 · Cabal file · Source archive
- containers-0.8.1 · Cabal revision 0 · Cabal file · Source archive
- deepseq-1.5.2.0 · Cabal revision 0 · Cabal file · Source archive
- mtl-2.3.2 · Cabal revision 1 · Cabal file · Source archive
- random-1.3.1 · Cabal revision 0 · Cabal file · Source archive
- splitmix-0.1.3.2 · Cabal revision 0 · Cabal file · Source archive
- transformers-0.6.3.0 · Cabal revision 2 · Cabal file · Source archive