inst/test-db/visibility.R

make_test(title = "value() - visibility", tags = c("value", "visibility"), {
  f <- future(42)
  res <- withVisible({
    value(f)
  })
  v <- res$value
  stopifnot(identical(v, 42))
  stopifnot(res$visible)

  f <- future(invisible(42))
  res <- withVisible({
    value(f)
  })
  v <- res$value
  stopifnot(identical(v, 42))
  stopifnot(!res$visible)
})

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.