tests/testthat/test-comb.R

test_that("combinations() behaves correctly in degenerate cases",
  {
    expect_identical(combinations(c()), matrix(0,1,0))
    expect_identical(combinations(c(0)), matrix(0,0,1))
    expect_identical(combinations(c(0,0)), matrix(0,0,2))
  })

test_that("powerSetMat() behaves correctly in degenerate cases",
{
  expect_identical(powerSetMat(0), matrix(0,1,0))
  expect_error(powerSetMat(-1))
})
rje42/rje documentation built on April 3, 2024, 11:08 p.m.