tests/testthat/test-timeout.R

test_that("test01", {
    it <- ihasNext(i_timeout(icount(), 2))
    x <- 0
    while (hasNext(it)) x <- nextOr(it, break)
    expect_true(x > 0)
})

test_that("test02", {
    n <- 1000
    actual <- as.list(i_timeout(icount(n), time = Inf))
    expected <- as.list(1:n)
    expect_equal(expected, actual)
})

Try the iterors package in your browser

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

iterors documentation built on May 31, 2023, 5:36 p.m.