tests/testthat/test-get_box_module_exports.R

options(box.path = file.path(getwd(), "mod"))

test_that("get_box_module_exports returns correct list of exported functions", {
  module <- "path/to/module_a"
  result <- get_box_module_exports(module)
  expected_output <- c("a_fun_a", "a_fun_b")
  expect_equal(result, expected_output)
})

test_that("get_box_module_exports returns correct list of exported data objects", {
  module <- "path/to/module_b"
  result <- get_box_module_exports(module)
  expected_output <- c("b_fun_a", "b_fun_b", "b_obj_a")
  expect_equal(result, expected_output)
})

Try the box.linters package in your browser

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

box.linters documentation built on June 26, 2025, 5:07 p.m.