tests/testthat/test_guardExecution.R

context("guardExecution")

g <- guardExecution(1:3 + 1:7, 'fakeFunction')

test_that("guardExecution - coverage", {
  expect_true(g$status)
  expect_true(grepl('simpleWarning', g$warning_message, fixed = TRUE))
  expect_false(guardExecution(abort('requested aborption'), 'fakeFunction')$status)
})

Try the wyz.code.metaTesting package in your browser

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

wyz.code.metaTesting documentation built on Sept. 25, 2023, 9:06 a.m.