tests/testthat/test-doctest-onetime_reset.R

# Generated by doctest: do not edit by hand
# Please edit file in R/utils.R

test_that("Doctest: onetime_reset", {
  # Created from @doctest for `onetime_reset`
  # Source file: R/utils.R
  # Source line: 12
  oo <- options(onetime.dir = tempdir(check = TRUE))
  id <- sample(10000L, 1)
  expect_message(onetime_message("will be shown", id = id), "will")
  expect_silent(onetime_message("won't be shown", id = id))
  onetime_reset(id = id)
  expect_message(onetime_message("will be shown", id = id), "will")
  onetime_reset(id = id)
  options(oo)
})

Try the onetime package in your browser

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

onetime documentation built on Sept. 3, 2023, 9:06 a.m.