Safe Haskell | None |
---|
This file should not be imported directly. Import Test.OITestGenerator instead.
- type Arg = Int
- data Op
- op :: Name -> Op
- arg :: Int -> Arg
- but :: Op -> Arg -> Op
- only :: Op -> Arg -> Op
- withGens :: HasGens a => a -> [Name] -> a
- withConstraint :: Op -> Name -> Op
- op_name :: Op -> Name
- op_args :: Op -> Q [Int]
- op_gens :: Op -> Q [Name]
- op_has_constraint :: Op -> Bool
- op_constraint :: Op -> Name
- op_maybe_constraint :: Op -> Maybe Name
Documentation
An operation. Contains information about the operation's name, which
arguments may be tested (all by default), which generators should be used for
each argument (arbitrary
by default) and possibly a constraint function.
but o i
excludes the i
-th argument from o
when generating tests.
Example:
op 'dequeue `but` arg 1
only o i
excludes all but the i
-th argument from o
when generating tests.
Example:
op 'dequeue `only` arg 1
withGens :: HasGens a => a -> [Name] -> aSource
Use to specify custom generators for the given operation or axiom. The
i
-th element of the list corresponds to the i
-th argument. All
generators must be specified. Not using a custom generator for specific
arguments can be achieved by passing arbitrary
.
withConstraint :: Op -> Name -> OpSource
op
adds a constraint function withConstraint
ff
to op
. f
must
take arguments of the same type as op
and return a Bool
.
op_has_constraint :: Op -> BoolSource
op_constraint :: Op -> NameSource
op_maybe_constraint :: Op -> Maybe NameSource