tests/testthat/test_printStrToChar.R

context("printStrToChar")

test_that("printStrToChar", {
  x = 1L
  s = printStrToChar(x, collapse=NULL)
  expect_equal(s, " int 1")
  s = printStrToChar(iris, collapse=NULL)
  expect_true(is.character(s) && length(s) == 6)
  s = printStrToChar(iris)
  expect_true(is.character(s) && length(s) == 1)
})

Try the BBmisc package in your browser

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

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.