tests/testthat/test-sub_fn_body_name.R

test_that("bind_fn_2_env() works", {

  a <- 1
  b <- 2
  d <- 3
  f <- function() a + b + a + d
  f1 <- sub_fn_body_name(f, "a", "b")

  expect_equal(f1(), 9)
})

Try the bandicoot package in your browser

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

bandicoot documentation built on May 29, 2024, 8:01 a.m.