tests/test_warningCondition.R

source("helper/helper.R")

if (exists("warningCondition", envir = baseenv())) {
  f = get("warningCondition", envir = baseenv())
  expect_same = makeCompareFun(f, backports:::warningCondition)

  expect_same("warning from backports test")
  expect_same("warning from backports test", class = "test_warning")
}

if (exists("errorCondition", envir = baseenv())) {
  f = get("errorCondition", envir = baseenv())
  expect_same = makeCompareFun(f, backports:::errorCondition)

  expect_same("error from backports test")
  expect_same("error from backports test", class = "test_error")
}

Try the backports package in your browser

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

backports documentation built on June 24, 2024, 5:24 p.m.