tests/testthat/helper-obj.R

returns_well_formed <- function(x, .ncol = NULL, .nrow = NULL, expected_names = NULL) {
  expect_s3_class(x, "tbl")
  if (!is.null(.ncol)) expect_length(x, .ncol)
  if (!is.null(.nrow)) expect_equal(nrow(x), .nrow)
  if (!is.null(expected_names)) expect_named(x, expected_names)
  invisible()
}

Try the precisely package in your browser

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

precisely documentation built on Oct. 10, 2021, 9:07 a.m.