tests/async/test-race.R

test_that("race() rejects (#76)", {
  defer_fail <- function() {
    deferred$new(action = function(resolve) stop("foo"))
  }

  expect_error(
    synchronise(async_race(
      delay(0.1),
      defer_fail()
    )),
    "foo"
  )
})

Try the pkgcache package in your browser

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

pkgcache documentation built on Sept. 13, 2024, 1:06 a.m.