tests/testthat/test_checkNull.R

context("checkNull")

test_that("checkNull", {
  myobj = NULL
  expect_succ_all(Null, myobj)
  myobj = TRUE
  expect_fail_all(Null, myobj)

  expect_false(testNull(integer(0)))
  expect_true(testNull(NULL))

  expect_error(assertNull(-1), "NULL")
})

Try the checkmate package in your browser

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

checkmate documentation built on Sept. 11, 2024, 8:40 p.m.