diff --git a/tests/testthat/_snaps/conditions.md b/tests/testthat/_snaps/conditions.md index 44f97f78..aaa62a6e 100644 --- a/tests/testthat/_snaps/conditions.md +++ b/tests/testthat/_snaps/conditions.md @@ -6,22 +6,11 @@ Warning in `f()`: Hi! -# all three starts of stop_on_error work as expected +# all three values of stop_on_error work as expected Code - evaluate("stop(\"1\")\n2", stop_on_error = 2L) + ev <- evaluate("stop(\"1\")\n2", stop_on_error = 2L) Condition Error: ! 1 - Output - - Source code: - stop("1") - Condition: - Error: - 1 - Source code: - 2 - Text output: - [1] 2 diff --git a/tests/testthat/test-conditions.R b/tests/testthat/test-conditions.R index 218cd096..f47737df 100644 --- a/tests/testthat/test-conditions.R +++ b/tests/testthat/test-conditions.R @@ -118,14 +118,14 @@ test_that("an error terminates evaluation of multi-expression input", { expect_output_types(ev, c("source", "error")) }) -test_that("all three starts of stop_on_error work as expected", { +test_that("all three values of stop_on_error work as expected", { ev <- evaluate('stop("1")\n2', stop_on_error = 0L) expect_output_types(ev, c("source", "error", "source", "text")) ev <- evaluate('stop("1")\n2', stop_on_error = 1L) expect_output_types(ev, c("source", "error")) - expect_snapshot(evaluate('stop("1")\n2', stop_on_error = 2L), error = TRUE) + expect_snapshot(ev <- evaluate("stop(\"1\")\n2", stop_on_error = 2L), error = TRUE) }) test_that("errors during printing are captured", {