R/test_progress_status.R

Defines functions test_progress_status

test_progress_status <-
function( step
        , total = NULL
        , title = NULL
        , label = NULL
        , ...
        , stack = 'with_progress'
        , class = "R6 Progress Base Class"
        ){
    assert_that(requireNamespace('testthat'))
    pb <- peek_progress('with_progress')
    testthat::expect_equal(pb$current, step-1)

    if(!is.null(class)) testthat::expect_is(pb, class)
    if(!is.null(total)) testthat::expect_equal(pb$total, total)
    if(!is.null(title)) testthat::expect_match(pb$title, title)
    if(!is.null(label)) testthat::expect_match(pb$label, label)
    invisible(TRUE)
}

Try the purrrogress package in your browser

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

purrrogress documentation built on July 23, 2019, 1:04 a.m.