tests/testthat/test-trans_path.R

path <- system.file("examples", package = "translated")

test_that("passing a path sets it", {
  trans_path(path)
  expect_equal(getOption("translated_path"), path)
})

test_that("not passing anything allows accessing currently set path", {
  expect_equal(trans_path(), path)
})

Try the translated package in your browser

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

translated documentation built on April 25, 2023, 5:09 p.m.