Open
Description
As part of developing a package there's a specific pattern I want to detect that leads to an infinite recursion error. (If this error ever doesn't happen, then it's likely I broke something in the logic, hence my desire to test for it.)
This test fails:
f <- function() f()
expect_error(f())
# Error: C stack usage 9522952 is too close to the limit
This passes, but is a bit clunky:
f <- function() f()
tryCatch({
f()
TRUE
}, error = \(e) {
FALSE
}) |> expect_false()
Should that first expect_error()
test fail, given that the second passes?
({testthat} v3.2.1)