☰
Debian Codegraph
@
3.0.3+dfsg-1
/
/
tests
/
testthat
/
test-wrap.R
☽
☼
tests/testthat/test-wrap.R
code
plain
raw
GPL-2+
2015-29016 Jim Hester, Kirill Müller, Hadley Wickham,; Winston Chang, RStudio
debian/copyright
1
test_that("wrap works", {
2
v <- c(0, 0, 0)
3
set <- function(x) v[2] <<- x
4
f <- wrap(set, v[1] <<- v[1] + 1, v[3] <<- v[3] + 3)
5
expect_equal(v, c(0, 0, 0))
6
f(2)
7
expect_equal(v, 1:3)
8
})