tests/testthat/test-function-cache_and_return.R

test_that("cache_and_return() works", {

  f <- kwb.utils:::cache_and_return
  
  expect_error(f())

  x <- 1
  
  expect_identical(f(x), x)
  expect_true(file.exists(kwb.utils:::get_cached_file("x")))
})
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.