Skip to contents

Repeatedly test properties of a function

Usage

repeat_test(property, tests = getOption("quickcheck.tests", 100L))

Arguments

property

A function with no parameters which includes an expectation.

tests

The number of tests to run.

Value

A testthat expectation object.

Examples

repeat_test(
  property = function() {
    num <- stats::runif(1, min = 0, max = 10)
    testthat::expect_true(num >= 0 && num <= 10)
  }
)