tests/async/test-reflect.R

test_that("async_reflect", {
  badfun <- async(function() stop("oh no!"))
  safefun <- async_reflect(badfun)

  do <- async(function() {
    when_all(safefun(), safefun(), safefun())$then(function(result) {
      for (i in 1:3) {
        expect_s3_class(result[[i]]$error, "error")
        expect_null(result[[i]]$value)
      }
    })
  })
  synchronise(do())
})

Try the pkgcache package in your browser

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

pkgcache documentation built on June 8, 2025, 10:49 a.m.