inst/test_engines.R

available.engines <- character()
for(e in c("RE2", "ICU", "PCRE")){
  is.available <- tryCatch({
    stop_for_engine(e)
    TRUE
  }, error=function(msg){
    FALSE
  })
  if(is.available){
    available.engines[[e]] <- e
  }
}
test_engines <- function(desc, ...){
  for(e in available.engines){
    old.opt <- options(nc.engine=e)
    test_that(paste(e, desc), ...)
    options(old.opt)
  }
}

Try the nc package in your browser

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

nc documentation built on Sept. 1, 2023, 1:07 a.m.