tests/testthat/test-repeat_test.R

test_that("repeat_test passes with a true expectation", {
  expect_silent(
    repeat_test(property = function() expect_true(TRUE))
  )
})

test_that("repeat_test fails with a false expectation", {
  expect_error(
    repeat_test(property = function() expect_true(FALSE))
  )
})

test_that("repeat_test fails with no expectation", {
  expect_error(
    repeat_test(property = function() a == 0)
  )
})

Try the quickcheck package in your browser

Any scripts or data that you put into this service are public.

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