tests/testthat/test_progressbar.R

context("progressbar tests")

test_that("progress bar", {
  # Just check that the progress bar - text output - doesn't crash. This check
  # exists mainly to unskew the coverage statistics because I can't test it
  # properly without lots of work

  expect_error(capture.output({
    n <- 20
    pb <- trajr:::ElapsedTimeProgressBarFn(n, trajr:::buildTxtReportFn("Progress"))
    for (i in 1:(n - 1)) {
      pb()
    }
    pb(close = TRUE)
    pb()
  }), NA)
})

Try the trajr package in your browser

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

trajr documentation built on July 9, 2023, 6:03 p.m.