tests/testthat/test-object-r6.R

test_that("extract_r6_data without source refs", {
  txt <- "R6::R6Class('foo',
     public = list(
       field1 = NULL,
       meth1 = function(Z) { },
       meth2 = function(Z = 10, ...) { },
       field2 = \"foobar\",
       meth3 = function() { }
     )
   )"
  C <- eval(parse(text = txt, keep.source = FALSE))
  expect_snapshot(extract_r6_data(C), error = TRUE)
})

Try the roxygen2 package in your browser

Any scripts or data that you put into this service are public.

roxygen2 documentation built on Dec. 9, 2022, 1:09 a.m.