Learn R Programming

quickcheck (version 0.1.3)

repeat_test: Repeatedly test properties of a function

Description

Repeatedly test properties of a function

Usage

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

Value

A testthat expectation object.

Arguments

property

A function with no parameters which includes an expectation.

tests

The number of tests to run.

Examples

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

Run the code above in your browser using DataLab