tests/testthat/helpers.R

passOnErrorMsg <- function(expr) {
  res <- try({
    expr
  })
  
  if (!inherits(res, "try-error")) return(res) else return(res[[1]])
}

foundResource <- function(testLoaded) {
  !(inherits(testLoaded, "character") && grepl(pattern = "No resource found", testLoaded))
}

Try the Pandora package in your browser

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

Pandora documentation built on June 22, 2024, 6:48 p.m.