Copyright  (c) 20152017 Rudy Matela 

License  3Clause BSD (see the file LICENSE) 
Maintainer  Rudy Matela <rudy@matela.com.br> 
Safe Haskell  None 
Language  Haskell2010 
Generate FitSpec
reports.
Synopsis
 report :: (Mutable a, ShowMutable a) => a > (a > [Property]) > IO ()
 reportWith :: (Mutable a, ShowMutable a) => Args > a > (a > [Property]) > IO ()
 reportWithExtra :: (Mutable a, ShowMutable a) => [a] > Args > a > (a > [Property]) > IO ()
 data Args = Args {}
 args :: Args
 fixargs :: Int > Int > Args
 type Property = [([String], Bool)]
 data ShowMutantAs
Documentation
report :: (Mutable a, ShowMutable a) => a > (a > [Property]) > IO () Source #
Report results generated by FitSpec.
Uses standard configuration (see args
).
Needs a function to be mutated and a property map.
Example (specification of boolean negation):
properties not = [ property $ \p > not (not p) == p , property $ \p > not (not (not p)) == not p ] main = report not properties
reportWith :: (Mutable a, ShowMutable a) => Args > a > (a > [Property]) > IO () Source #
reportWithExtra :: (Mutable a, ShowMutable a) => [a] > Args > a > (a > [Property]) > IO () Source #
Same as reportWith
, but accepts a list of manually defined (extra)
mutants to be tested alongside those automatically generated.
Extra arguments / configuration for reportWith
.
See args
for default values.
Args  

Instances
Data Args Source #  
Defined in Test.FitSpec.Main gfoldl :: (forall d b. Data d => c (d > b) > d > c b) > (forall g. g > c g) > Args > c Args # gunfold :: (forall b r. Data b => c (b > r) > c r) > (forall r. r > c r) > Constr > c Args # dataTypeOf :: Args > DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) > Maybe (c Args) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) > Maybe (c Args) # gmapT :: (forall b. Data b => b > b) > Args > Args # gmapQl :: (r > r' > r) > r > (forall d. Data d => d > r') > Args > r # gmapQr :: forall r r'. (r' > r > r) > r > (forall d. Data d => d > r') > Args > r # gmapQ :: (forall d. Data d => d > u) > Args > [u] # gmapQi :: Int > (forall d. Data d => d > u) > Args > u # gmapM :: Monad m => (forall d. Data d => d > m d) > Args > m Args # gmapMp :: MonadPlus m => (forall d. Data d => d > m d) > Args > m Args # gmapMo :: MonadPlus m => (forall d. Data d => d > m d) > Args > m Args # 
Default arguments for reportWith
:
nMutants = 500
, start with 500 mutantsnTests = 1000
, start with 1000 test valuestimeout = 5
, keep incresing the number of mutants until 5 seconds elapsenames = []
, default function call template:
["f x y z", "g x y z", "h x y z", ...]
fixargs :: Int > Int > Args Source #
Non timedout default arguments. Make conjectures based on a fixed number of mutants and tests, e.g.:
reportWith (fixargs 100 200) f pmap
This is just a shorthand, see:
fixargs nm nt = args { nMutants = nm, nTests = nt, timeout = 0 }
(fixargs nm nt) { nMutants = 500, nTests = 1000, timeout = 5 } = args
type Property = [([String], Bool)] Source #
An encoded representation of a property suitable for use by FitSpec.
Each list of strings is a printable representation of one possible choice of argument values for the property. Each boolean indicate whether the property holds for this choice.
data ShowMutantAs Source #
How to show mutants. Use this to fill showMutantAs
.
Instances
Data ShowMutantAs Source #  
Defined in Test.FitSpec.Main gfoldl :: (forall d b. Data d => c (d > b) > d > c b) > (forall g. g > c g) > ShowMutantAs > c ShowMutantAs # gunfold :: (forall b r. Data b => c (b > r) > c r) > (forall r. r > c r) > Constr > c ShowMutantAs # toConstr :: ShowMutantAs > Constr # dataTypeOf :: ShowMutantAs > DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) > Maybe (c ShowMutantAs) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) > Maybe (c ShowMutantAs) # gmapT :: (forall b. Data b => b > b) > ShowMutantAs > ShowMutantAs # gmapQl :: (r > r' > r) > r > (forall d. Data d => d > r') > ShowMutantAs > r # gmapQr :: forall r r'. (r' > r > r) > r > (forall d. Data d => d > r') > ShowMutantAs > r # gmapQ :: (forall d. Data d => d > u) > ShowMutantAs > [u] # gmapQi :: Int > (forall d. Data d => d > u) > ShowMutantAs > u # gmapM :: Monad m => (forall d. Data d => d > m d) > ShowMutantAs > m ShowMutantAs # gmapMp :: MonadPlus m => (forall d. Data d => d > m d) > ShowMutantAs > m ShowMutantAs # gmapMo :: MonadPlus m => (forall d. Data d => d > m d) > ShowMutantAs > m ShowMutantAs # 