tests/testthat/test-utils.R

test_that("utils work as expected", {

  set_options("my_first_key", 10)

  expect_equal(get_options("my_first_key"), 10)

  set_options("my_second_key", "random")

  lop <- list_options()
  expect_true("my_first_key" %in% lop)
  expect_true("my_second_key" %in% lop)
  expect_false("my_ff_key" %in% lop)

})

Try the CRE package in your browser

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

CRE documentation built on Oct. 19, 2024, 5:07 p.m.