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)
})
hughjonesd/onetime documentation built on Jan. 24, 2025, 2:49 p.m.