tests/testthat/test-chunk_generic.R

test_that("When passed a generic string, it gets added to the code slot of a Repro object", {
  repro_obj <- repro_chunk("foo")

  expect_s7_class(repro_obj, Repro)
  expect_identical(repro_obj@code, list("foo"))
  expect_identical(repro_obj@packages, character(0L))
  expect_identical(repro_obj@prerequisites, list())
  expect_identical(repro_obj@script, "\"foo\"")
})

Try the shinyreprex package in your browser

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

shinyreprex documentation built on April 27, 2026, 9:10 a.m.