tests/testthat/setup.R

as_r_cmd_check <- function(expr, pkg = "pkg") {
  withr::with_envvar(
    list("_R_CHECK_PACKAGE_NAME_" = pkg),
    expr
  )
}

as_not_r_cmd_check <- function(expr) {
  withr::with_envvar(
    list("_R_CHECK_PACKAGE_NAME_" = NA),
    expr
  )
}

Try the testex package in your browser

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

testex documentation built on June 22, 2024, 11:14 a.m.