tests/testthat/test-sleep.R

test_that("sleep works", {
  before <- Sys.time()
  sleep()  # default: 5 sec
  after <- Sys.time()
  expect_identical((after - before) > 5, TRUE)

  before <- Sys.time()
  sleep(3)
  after <- Sys.time()
  expect_identical((after - before) > 3, TRUE)
})

Try the clidatajp package in your browser

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

clidatajp documentation built on March 7, 2023, 8:10 p.m.