inst/test-db/globalenv.R

make_test(title = "future() - rm() a global variable", args = list(lazy = c(FALSE, TRUE)), tags = c("future", "globalenv"), {
  a <- 42
  f <- future({
    a
    a <- 3.14
    rm(a)
    a
  }, lazy = lazy)
  rm(list = "a")
  stopifnot(value(f) == 42L)
})
HenrikBengtsson/future.tests documentation built on May 28, 2023, 2:56 a.m.