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)
    }
  )
})
ThinkR-open/shinipsum documentation built on Feb. 10, 2024, 2:16 a.m.