tests/testthat/mod/nested/relative_a.r

box::use(mod/a)

# Muffle message
silently = function (expr) {
    on.exit({sink(); close(file)})
    file = textConnection('out', 'w', local = TRUE)
    sink(file)
    expr
}

silently(box::use(local_a = ./a))

#' @export
a_which = function () a$which()

#' @export
local_a_which = function () local_a$which()

Try the box package in your browser

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

box documentation built on May 2, 2023, 9:14 a.m.