tests/testthat/test-adverb-insistently.R

test_that("insistently() resets rate state", {
  fn <- insistently(compose(), rate_delay(1, max_times = 0))
  expect_snapshot_error(fn(), class = "purrr_error_rate_excess")
  expect_snapshot_error(fn(), class = "purrr_error_rate_excess")
})

test_that("validates inputs", {
  expect_snapshot(error = TRUE, {
    insistently(mean, 10)
  })
})

Try the purrr package in your browser

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

purrr documentation built on Aug. 10, 2023, 9:08 a.m.