tests/testthat/test-function-catf.R

test_that("catf() works", {

  f <- kwb.prep:::catf
  
  expect_error(f())
  
  expect_identical(capture.output(f("abc")), "abc")
  expect_identical(capture.output(f("%s", "abc")), "abc")
  expect_identical(capture.output(f("%d items", 10L)), "10 items")
})
KWB-R/kwb.prep documentation built on June 11, 2022, 1:29 p.m.