tests/testthat/test-inject-funs.R

test_that("can inject functons into evaluation context", {
  old <- inject_funs(f = function() 1)
  defer(inject_funs(old))

  ev <- evaluate("f()")
  expect_equal(ev[[2]], "[1] 1\n")
})

Try the evaluate package in your browser

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

evaluate documentation built on Oct. 10, 2024, 5:06 p.m.