Commit aa8db753 authored by Michael Hanus 's avatar Michael Hanus
Browse files

Test.Prop updated

parent 7bc0641f
......@@ -26,7 +26,7 @@ module Test.EasyCheck (
test, is, isAlways, isEventually, uniquely, always, eventually,
failing, successful, deterministic, (-=-), (<~>), (~>), (<~), (<~~>),
(#), (#<), (#>),
(#), (#<), (#>), (<=>),
solutionOf,
-- test annotations
......@@ -46,7 +46,7 @@ import SearchTree ( SearchTree, someSearchTree )
import SearchTreeTraversal
infix 1 `is`, `isAlways`, `isEventually`
infix 1 -=-, <~>, ~>, <~, <~~>, `trivial`, #, #<, #>
infix 1 -=-, <~>, ~>, <~, <~~>, `trivial`, #, #<, #>, <=>
infix 1 `returns`, `sameReturns`
infixr 0 ==>
......@@ -286,6 +286,13 @@ forAllValues c vals f =
diagonal
[[ updArgs (show y:) t | let Prop ts = c (f y), t <- ts ] | y <- vals ]
--- The property `f <=> g` is satisfied if `f` and `g` are equivalent
--- operations, i.e., they can be replaced in any context without changing
--- the computed results.
(<=>) :: a -> a -> Prop
_ <=> _ = error $
"Test.Prop.<=> not executable. Use CurryCheck to test this property!"
-------------------------------------------------------------------------
-- Test Annotations
......
......@@ -26,11 +26,11 @@ module Test.Prop (
-- test specification:
PropIO, returns, sameReturns, toError, toIOError,
Prop, (==>), for,
Prop, (==>), for, forAll,
is, isAlways, isEventually, uniquely, always, eventually,
failing, successful, deterministic, (-=-), (<~>), (~>), (<~), (<~~>),
(#), (#<), (#>),
(#), (#<), (#>), (<=>),
solutionOf,
-- test annotations
......@@ -42,7 +42,7 @@ module Test.Prop (
) where
infix 1 `is`, `isAlways`, `isEventually`
infix 1 -=-, <~>, ~>, <~, <~~>, `trivial`, #, #<, #>
infix 1 -=-, <~>, ~>, <~, <~~>, `trivial`, #, #<, #>, <=>
infix 1 `returns`, `sameReturns`
infixr 0 ==>
......@@ -169,6 +169,17 @@ _ #> _ = propUndefinedError "#>"
for :: Show a => a -> (a -> Prop) -> Prop
for _ _ = propUndefinedError "for"
--- The property `forAll xs p` is satisfied if all values `x` of the list `xs`
--- satisfy property `p x`.
forAll :: Show a => [a] -> (a -> Prop) -> Prop
forAll _ _ = propUndefinedError "forAll"
--- The property `f <=> g` is satisfied if `f` and `g` are equivalent
--- operations, i.e., they can be replaced in any context without changing
--- the computed results.
(<=>) :: a -> a -> Prop
_ <=> _ = propUndefinedError "#"
-------------------------------------------------------------------------
-- Test Annotations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment