tests/testthat/test-catch.R

test_that("get_routine() finds own 'run_testthat_tests'", {
  routine <- get_routine("testthat", "run_testthat_tests")
  expect_s3_class(routine, "NativeSymbolInfo")
})

test_that("get_routine() fails when no routine exists", {
  expect_error(get_routine("utils", "no_such_routine"))
})

run_cpp_tests("testthat")

Try the testthat package in your browser

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

testthat documentation built on Jan. 21, 2022, 1:10 a.m.