repeat_test: Repeatedly test properties of a function

View source: R/repeat_test.R

repeat_testR Documentation

Repeatedly test properties of a function

Description

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)
  }
)

quickcheck documentation built on Oct. 12, 2023, 1:08 a.m.