Safe Haskell | None |
---|
This file should not be imported directly. Import Test.OITestGenerator instead.
- data Axiom
- axiom :: Name -> Axiom
- withGens :: HasGens a => a -> [Name] -> a
- axiom_name :: Axiom -> Name
- axiom_gens :: Axiom -> Q [Name]
- data AxiomResult a
- ar_cond :: AxiomResult a -> Bool
- ar_lhs :: AxiomResult a -> a
- ar_rhs :: AxiomResult a -> a
- (=!=) :: a -> a -> AxiomResult a
- (===>) :: Bool -> AxiomResult a -> AxiomResult a
Documentation
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
.
axiom_name :: Axiom -> NameSource
axiom_gens :: Axiom -> Q [Name]Source
data AxiomResult a Source
ar_cond :: AxiomResult a -> BoolSource
ar_lhs :: AxiomResult a -> aSource
ar_rhs :: AxiomResult a -> aSource
(=!=) :: a -> a -> AxiomResult aSource
Combine the results of the left- and right-hand sides of an axiom. A simple example is
q1 :: AxiomResult Bool q1 = isEmpty empty =!= True
while an axiom with variables would be written as a function like this:
q2 :: Int -> IntQueue -> AxiomResult Bool q2 x q = isEmpty (enqueue x q) =!= False
(===>) :: Bool -> AxiomResult a -> AxiomResult aSource
Adds a condition to an axiom. If the Bool
argument is False
, the axiom
won't be evaluated. The test will neither count as a failed test, nor as
a successful test. It translates to QuickChecks ==>
operator.
Example usage:
q4 :: Int -> IntQueue -> AxiomResult Int q4 x q = not (isEmpty q) ===> front (enqueue x q) =!= front q