tests/testthat/test_filterNull.R

context("filterNull")

test_that("filterNull", {
  li = list(1, 2, NULL, 3)
  expect_equal(filterNull(li), list(1, 2, 3))
  expect_equal(filterNull(list()), list())
  expect_error(filterNull(iris))
})

Try the BBmisc package in your browser

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

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.