tests/testthat/test-quantify.R

test_that("quantify functions properly with a logical vector", {
  set.seed(42)
  x <- sample(c(TRUE, FALSE), size=10, replace=TRUE)
  expect_equal(quantify(x), sum(x))
})

test_that("quantify functions properly with an iterator from a logical vector", {
  set.seed(42)
  x <- sample(c(TRUE, FALSE), size=10, replace=TRUE)
  it <- iteror(x)
  expect_equal(quantify(it), sum(x))
})

Try the iterors package in your browser

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

iterors documentation built on May 31, 2023, 5:36 p.m.