tests/testthat/test-function-warnIfEmpty.R

test_that("warnIfEmpty() works", {

  expect_warning(warnIfEmpty(NULL))  
  expect_warning(warnIfEmpty(data.frame()))  
  expect_warning(warnIfEmpty(list()))
  expect_warning(warnIfEmpty(c()))
  
  expect_silent(data.frame(a = 1))
  expect_silent(list(a = 1))
  expect_silent(1)
})
KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.