tests/testthat/test_checkListElementClass.R

context("checkListElementClass")

test_that("checkListElementClass", {
  checkListElementClass(list(1, 5), cl="numeric")
  expect_error(checkListElementClass(list(1, "a"), cl="numeric"), "numeric")
  
  xs = list("a", "b")
  checkListElementClass(xs, "character")
  expect_error(checkListElementClass(xs, "integer"), "character")
})

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.