powered by
Test properties of a function
for_all( ..., property, tests = getOption("quickcheck.tests", 100L), shrinks = getOption("quickcheck.shrinks", 100L), discards = getOption("quickcheck.discards", 100L) )
A testthat expectation object.
testthat
Named generators
A function which takes values from from the generator and calls an expectation on it. This function must have parameters matching the generator names.
The number of tests to run.
The maximum number of shrinks to run when shrinking a value to find the smallest counterexample.
The maximum number of discards to permit when running the property.
for_all( a = numeric_(len = 1L), b = numeric_(len = 1L), property = function(a, b) testthat::expect_equal(a + b, b + a), tests = 10L )
Run the code above in your browser using DataLab