tests/async/test-retryable.R

test_that("async_retryable", {

  do <- async(function() {
    i <- 1
    f <- function() {
      i <<- i + 1
      if (i < 5) stop("error") else "OK"
    }

    async_retryable(f, 5)()
  })
  expect_identical(synchronise(do()), "OK")
})

Try the pkgcache package in your browser

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

pkgcache documentation built on July 26, 2023, 5:44 p.m.