Skip to content

Commit

Permalink
Merge pull request #737 from r-lib/snapshot-rlang-1-1-4
Browse files Browse the repository at this point in the history
Add snapshot for current rlang (v1.1.4)
  • Loading branch information
gaborcsardi authored Oct 25, 2024
2 parents fb314ce + 87445c2 commit 617334d
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions tests/testthat/_snaps/rlang-1.1.4/rlang-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# cli_abort() captures correct call and backtrace

Code
print(expect_error(f()))
Output
<error/rlang_error>
Error in `h()`:
! foo
---
Backtrace:
x
1. +-base::print(expect_error(f()))
2. +-testthat::expect_error(f())
3. | \-testthat:::expect_condition_matching(...)
4. | \-testthat:::quasi_capture(...)
5. | +-testthat (local) .capture(...)
6. | | \-base::withCallingHandlers(...)
7. | \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
8. \-cli (local) f()
9. \-cli (local) g()
10. \-cli (local) h()

---

Code
print(expect_error(f(list())))
Output
<error/cli_my_class>
Error in `h()`:
! `x` can't be empty.
---
Backtrace:
x
1. +-base::print(expect_error(f(list())))
2. +-testthat::expect_error(f(list()))
3. | \-testthat:::expect_condition_matching(...)
4. | \-testthat:::quasi_capture(...)
5. | +-testthat (local) .capture(...)
6. | | \-base::withCallingHandlers(...)
7. | \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
8. \-cli (local) f(list())
9. \-cli (local) g(x)
10. \-cli (local) h(x)

# cli_abort(.internal = TRUE) reports the correct function (r-lib/rlang#1386)

Code
(expect_error(fn()))
Output
<error/rlang_error>
Error in `fn()`:
! Message.
i This is an internal error that was detected in the base package.

0 comments on commit 617334d

Please sign in to comment.