Debian Codegraph @

tests/testthat/test-call.R

raw
1
2 test_that("renv_call_matches() works as expected", {
3
4 call <- quote(foo(1, 2))
5 expect_true(renv_call_matches(call, "foo"))
6 expect_true(renv_call_matches(call, "foo", nargs = 2L))
7 expect_false(renv_call_matches(call, "bar"))
8 expect_false(renv_call_matches(call, "bar", nargs = 1L))
9 expect_true(renv_call_matches(call, names = c("foo", "bar")))
10 expect_true(renv_call_matches(call, names = c("foo", "bar"), nargs = 2L))
11
12 })
13
14 test_that("renv_call_expect() works as expected", {
15 node <- quote(R6::R6Class("Class", inherit = "ParentClass"))
16 class <- renv_call_expect(node, "R6", "R6Class")
17 expect_identical(class, quote(R6Class("Class", inherit = "ParentClass")))
18 })