tests/testthat/test-cat.R

test_that("cat_line appends to file", {
  tmp <- tempfile()
  cat_line("a", file = tmp)
  cat_line("b", file = tmp)
  expect_equal(readLines(tmp), c("a", "b"))
})

Try the cli package in your browser

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

cli documentation built on March 31, 2023, 9:04 p.m.