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)
})

Try the future.tests package in your browser

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

future.tests documentation built on May 31, 2023, 9:28 p.m.