Test properties of a function
Arguments
- ...
Named generators
- property
A function which takes values from from the generator and calls an expectation on it. This function must have parameters matching the generator names.
- tests
The number of tests to run.
- shrinks
The maximum number of shrinks to run when shrinking a value to find the smallest counterexample.
- discards
The maximum number of discards to permit when running the property.
Examples
for_all(
a = numeric_(len = 1L),
b = numeric_(len = 1L),
property = function(a, b) testthat::expect_equal(a + b, b + a),
tests = 10L
)