tests/testthat/test-random.R

context("test-random.R")

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

test_that("random works", {
  lapply(
    1:100, function(x){
      expect_length(vec_ipsum(10), 10)
      expect_length(vec_ipsum(100), 100)
      expect_nrow(random_ipsum(10, 10), 10)
      expect_nrow(random_ipsum(100, 10), 100)
      expect_ncol(random_ipsum(10, 10), 10)
      expect_ncol(random_ipsum(10, 100), 100)
    })
})

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.