tests/testthat/test-dt.R

context("test-dt.R")

expect_ncol <- function(a, b){
  expect_equal(
    ncol(a) - 1,
    b
  )
}
expect_nrow <- function(a, b){
  expect_equal(
    nrow(a),
    b
  )
}

test_that("DT works", {
  lapply(
    1:100, function(x){
      a <- random_DT(10, 15)
      expect_nrow(a$x$data, 10)
      expect_ncol(a$x$data, 15)
    }
  )
})

Try the shinipsum package in your browser

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

shinipsum documentation built on May 29, 2024, 2:30 a.m.