R/zzz.R

Defines functions .onLoad

# clean up the temp library created in test_pkg() at the end of the R session
.onLoad = function(libname, pkgname) {
  reg.finalizer(.env, function(e) {
    unlink(e$lib_new, recursive = TRUE)
    if (!is.null(e$lib_old)) .libPaths(e$lib_old)
  }, onexit = TRUE)
}

Try the testit package in your browser

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

testit documentation built on April 14, 2021, 5:07 p.m.