tests/testthat/helper-structure.R

expect_have_argument <- function(pattern, arg = "error_call") {
  ns <- asNamespace("polish")
  funs <- ls(ns, pattern = pattern)
  purrr::walk(funs, \(fun) {
    f <- get(fun, envir = ns)
    form <- formals(f)
    expect_true(arg %in% names(form), info = glue::glue("{fun}() must take an `{arg}=` argument"))
  })
}

Try the polish package in your browser

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

polish documentation built on June 3, 2026, 5:07 p.m.