tests/testthat/test_count.R

test_that("count", {
  expect_identical(count(1:3), 3L)
  expect_identical(count(integer(0L)), 0L)
  expect_identical(count(list()), 0L)
  expect_identical(count(c(TRUE, NA, FALSE)), 2L)
  expect_identical(count(c(1L, NA, 3L)), 2L)
  expect_identical(count(c(1., NA, 3.)), 2L)
  expect_identical(count(c("a", NA, "c")), 2L)
  expect_identical(count(list(1, NULL, 3)), 2L)
})

Try the batchtools package in your browser

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

batchtools documentation built on April 20, 2023, 5:09 p.m.