ExCheck v0.5.2 ExCheck.Predicate

Provides macros for predicates.

Summary

Macros

Verify the property is hold for all the generated samples. > for_all x in int, do: x * x >= 0

Verify the property is hold for all the generated samples. > for_all(x, int) do > x * x >= 0 > end

Skip samples that does not satisfy the predicate

Generate samples which satisfies the predicate

Specify the block to be executed with timeout

Specify the block to be executed with spawn_link

Specify the block to be called when the test is failed

Macros

for_all(arg, list)

Verify the property is hold for all the generated samples. > for_all x in int, do: x * x >= 0

for_all(x, generator, list)

Verify the property is hold for all the generated samples. > for_all(x, int) do > x * x >= 0 > end

implies(predicate, list)

Skip samples that does not satisfy the predicate.

such_that(arg)

Generate samples which satisfies the predicate.

timeout(limit, list)

Specify the block to be executed with timeout.

trap_exit(list)

Specify the block to be executed with spawn_link

when_fail(action, list)

Specify the block to be called when the test is failed.