Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: r-lib/evaluate
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bc3e3d7c6f9171018a28fe3d4b3d42a31d28dbb4
Choose a base ref
..
head repository: r-lib/evaluate
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 880b664fb75e16e795ed5ec188d7501ae16a0d59
Choose a head ref
Original file line number Diff line number Diff line change
@@ -8,5 +8,5 @@ Backtrace:
2. global g()
3. global h()

Quitting from lines 11-15 [unnamed-chunk-2] (ressources/with-stop-error-auto-entrace.Rmd)
Quitting from lines 6-10 [unnamed-chunk-1] (ressources/with-stop-error-auto-entrace.Rmd)
Execution halted
15 changes: 15 additions & 0 deletions tests/testthat/_snaps/conditions/rmd-stop-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: document with error
---


``` r
f <- function() g()
g <- function() h()
h <- function() stop("!")
f()
```

```
## Error in h(): !
```
5 changes: 0 additions & 5 deletions tests/testthat/ressources/with-stop-error-auto-entrace.Rmd
Original file line number Diff line number Diff line change
@@ -2,11 +2,6 @@
title: document with error
---

```{r}
rlang::global_entrace()
options(rlang_backtrace_on_error_report = "full")
```

```{r}
f <- function() g()
g <- function() h()
2 changes: 1 addition & 1 deletion tests/testthat/ressources/with-stop-error-sewed.Rmd
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@ title: document with error

```{r}
rlang::global_entrace()
options(rlang_backtrace_on_error_report = "full")
```


```{r}
f <- function() g()
g <- function() h()
4 changes: 4 additions & 0 deletions tests/testthat/test-conditions.R
Original file line number Diff line number Diff line change
@@ -185,6 +185,10 @@ test_that("Error can be entraced and correctly handled in outputs", {
withr::with_options(list(options(knitr.chunk.error = TRUE)), {
expect_snapshot_file(
knitr::knit(test_path("ressources/with-stop-error-auto-entrace.Rmd"), output = out, quiet = TRUE),
name = "rmd-stop-error.md"
)
expect_snapshot_file(
knitr::knit(test_path("ressources/with-stop-error-sewed.Rmd"), output = out, quiet = TRUE),
name = "rmd-stop-error-entrace-sewed.md"
)
expect_snapshot_file(