Skip to content

Commit

Permalink
add snapshot varient for R version < 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Nov 1, 2024
1 parent aaa3b04 commit 2fe7ce1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/testthat/_snaps/R-lt-4-3/method-dispatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# method dispatch works for class_missing

Code
foo_wrapper()
Condition
Error in `S7::S7_dispatch()`:
! argument "xx" is missing, with no default

6 changes: 5 additions & 1 deletion tests/testthat/test-method-dispatch.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ test_that("method dispatch works for class_missing", {

# dispatch on class_missing only works directly in the generic call
foo_wrapper <- function(xx) foo(xx)
expect_snapshot(error = TRUE, foo_wrapper())
expect_snapshot(
error = TRUE,
variant = if (getRversion() < "4.3") "R-lt-4-3",
foo_wrapper()
)

})

0 comments on commit 2fe7ce1

Please sign in to comment.