tests/testthat/test-expect-chk-error.R

test_that("expect-chk-error", {
  expect_s3_class(expect_chk_error(chk_flag(1)), "chk_error")
  expect_error(expect_chk_error(chk_flag(TRUE)), "",
    class = "expectation_failure"
  )
  expect_error(expect_chk_error(chk_flag(TRUE), class = "chk_error"), "`class` must be NULL.")
})

Try the chk package in your browser

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

chk documentation built on April 3, 2025, 8:50 p.m.