tests/testthat/test-tag-expectRaw.R

test_that("@expectRaw", {
  raw_expectation <- "
                      #' @doctest
                      #' @expectRaw equal(2 + 2, 4)
                      NULL
                     " |> dedent()
  results <- roc_proc_text(dt_roclet(), raw_expectation)
  expect_snapshot_output(
    roclet_output(dt_roclet(), results)
  )
})

Try the doctest package in your browser

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

doctest documentation built on May 29, 2024, 7:09 a.m.