tests/testthat/test-internal.R

test_that(
  "print_and_capture returns a string of the captured output.",
  {
    expected <- "  x\n1 a\n2 b\n3 c"
    actual <- print_and_capture(data.frame(x = letters[1:3]))
    expect_equal(actual, expected)
  }
)

Try the assertive.base package in your browser

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

assertive.base documentation built on Feb. 8, 2021, 9:06 a.m.