tests/testthat/helper.R

get_output <- function(expr) {
  msgs <- character()
  i <- 0
  suppressMessages(withCallingHandlers(
    expr,
    message = function(e) msgs[[i <<- i + 1]] <<- conditionMessage(e)))
  paste0(msgs, collapse = "")
}
gaborcsardi/progress documentation built on Jan. 5, 2024, 4:25 a.m.