tests/testthat/test_stop.R

context("stops (errors)")

test_that("stop_via", {
  expect_error(stop_via("qed"), "qed")
  expect_error(stop_via("qed", FUNCTION = "abc"))
  expect_match(tryCatch(stop_via("qed", FUNCTION = "abc"),
                        error = function(e) deparse(e$c)),
               "abc")
               
})

Try the grattan package in your browser

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

grattan documentation built on Sept. 4, 2023, 5:08 p.m.