tests/testthat/test-is_try_error.R

context("test-is_try_error")

test_that("is_try_error works", {
  x <- attempt(log("a"), silent = TRUE)
  expect_true(is_try_error(x))
  x <- attempt(log(10), silent = TRUE)
  expect_false(is_try_error(x))
})

Try the attempt package in your browser

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

attempt documentation built on May 4, 2020, 1:05 a.m.