tests/testthat/test-tag-testRaw.R

test_that("@testRaw", {
  raw_expectation <- "
                      #' @doctest
                      #' @testRaw skip_on_cran()
                      #' @expect error()
                      #' stop(\"Argh, CRAN won't like it\")
                      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.