PropCheck.implies
You're seeing just the macro
implies
, go back to PropCheck module for more information.
A property that is only tested if a condition is true.
This wrapper only makes sense when in the scope of at least one
forall
. The precondition
field must be a boolean expression or a
statement block that returns a boolean. If the precondition evaluates to
false
for the variable instances produced in the enclosing forall
wrappers, the test case is rejected (it doesn't count as a failing test
case), and PropCheck
starts over with a new random test case. Also, in
verbose mode, an x
is printed on screen.
iex> use PropCheck
iex> require Integer
iex> quickcheck(
...> forall n <- nat() do
...> implies rem(n, 2) == 0, do: Integer.is_even n
...> end
...>)
true