tests/testthat/test-raiser.R

test_that("Raisers", {
  error <- e("Problem")

  foo <- function(msg){
    cat(msg)
  }

  # read only
  testthat::expect_error(error$raiser)

  error$raiser <- foo

  testthat::expect_snapshot_output(error$raise())

  raise.e(foo)
  raise.w(foo)

  testthat::expect_snapshot_output(error$raise())

  warn <- w("Warning")
  testthat::expect_snapshot_output(warn$raise())

  raise.e()
  raise.w()
})
devOpifex/erratum documentation built on Feb. 5, 2024, 1:58 p.m.