tests/testthat/test-binary_entropy_counts.R

test_that("binary_entropy_counts() fails gracefully", {
  expect_equal(binary_entropy_counts(integer(0), 0), numeric(0))
  expect_equal(binary_entropy_counts(integer(3), 0), rep(NA_real_, 3))
  expect_equal(binary_entropy_counts(integer(3), 2), rep(0, 3))
  expect_equal(binary_entropy_counts(c(1, NA, 2), 2), c(1, NA, 0))
})

Try the TreeDist package in your browser

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

TreeDist documentation built on Feb. 13, 2026, 5:10 p.m.