tests/testthat/test-zzz.R

skip_if_not_installed("callr")

test_that("tests for zzz", {
  # We need to use callr to avoid conflicts with other tests
  res <- callr::r(
    function() {
      library(linelist)
      get_lost_tags_action()
    }
  )
  expect_identical(res, "warning")

})

test_that("Environment variable is used for initial `lost_tags_action`", {
  # We need to use callr to avoid conflicts with other tests
  res <- callr::r(
    function() {
      library(linelist)
      get_lost_tags_action()
    },
    env = c(LINELIST_LOST_ACTION = "error")
  )
  expect_identical(res, "error")

})

Try the linelist package in your browser

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

linelist documentation built on June 22, 2024, 10:54 a.m.