Closed
Description
I'm using checkmate
expect_*()
to run (input) validation for my functions in some package.
If I want to test these validations in turn, using testthat, the usual expect_error()
does fails, even when the expression does in fact error out as it should.
MWE from @mllg:
context("nested expect")
foo = function(x) {
expect_true(x)
stop("myerror")
}
test_that("nested expect", {
expect_error(foo("a"), "myerror")
})
Issue was originally raised over at checkmate
in mllg/checkmate#82.
@mllg suspected it might be a testthat issue.