dwww Home | Show directory contents | Find package

test_that("wrap works", {
  v <- c(0, 0, 0)
  set <- function(x) v[2] <<- x
  f <- wrap(set, v[1] <<- v[1] + 1, v[3] <<- v[3] + 3)
  expect_equal(v, c(0, 0, 0))
  f(2)
  expect_equal(v, 1:3)
})

Generated by dwww version 1.15 on Wed May 22 17:52:13 CEST 2024.