tests/testthat/test-throw.R

testthat::context("Testing HandTill2001:::throw()")
testthat::test_that("throw the HandTill2001 exception", {
  error_message <- "hello, testthat"
  string <- "hello, testthat"
  testthat::expect_error(
    HandTill2001:::throw(string),
    regexp = error_message,
    class = c("error", "HandTill2001", "condition")
  )
})

Try the HandTill2001 package in your browser

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

HandTill2001 documentation built on June 8, 2025, 1:31 p.m.