tests/testthat/test-power-set.R

test_that("power_set works", {
  expect_equal(is.list(power_set(5)), TRUE)
  expect_equal(length(power_set(5)), 2^5 - 1)

  expect_error(power_set(0))
  expect_lt(length(power_set(4, ordinal = TRUE)), 2^4 - 1)
})

Try the OTrecod package in your browser

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

OTrecod documentation built on Oct. 5, 2022, 5:06 p.m.