Skip to content

Commit 2fe7ce1

Browse files
committed
add snapshot varient for R version < 4.3
1 parent aaa3b04 commit 2fe7ce1

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# method dispatch works for class_missing
2+
3+
Code
4+
foo_wrapper()
5+
Condition
6+
Error in `S7::S7_dispatch()`:
7+
! argument "xx" is missing, with no default
8+

tests/testthat/test-method-dispatch.R

+5-1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ test_that("method dispatch works for class_missing", {
220220

221221
# dispatch on class_missing only works directly in the generic call
222222
foo_wrapper <- function(xx) foo(xx)
223-
expect_snapshot(error = TRUE, foo_wrapper())
223+
expect_snapshot(
224+
error = TRUE,
225+
variant = if (getRversion() < "4.3") "R-lt-4-3",
226+
foo_wrapper()
227+
)
224228

225229
})

0 commit comments

Comments
 (0)