tests/testthat/test-try_silent.R

test_that("try an expression silently works", {
  expect_equal(try_silent(1 + 1), 2)
  expect_s3_class(try_silent(1 + "1"), "fail")
})

Try the oeli package in your browser

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

oeli documentation built on Oct. 16, 2024, 5:08 p.m.