tests/testthat/test-shannon.R

context("shannon")
library(breakaway)

test_that("shannon isn't crazy", {
  
  expect_equal(true_shannon(c(0.5, 0.5)), 
               log(2))
  
})

test_that("good_turing works", {
  
  expect_error(good_turing(c(0.2, 0.8)))
  expect_is(good_turing(apples), "alpha_estimate")
  
})

test_that("chao_shen works", {
  
  expect_error(chao_shen(c(0.2, 0.8)))
  expect_is(chao_shen(apples), "alpha_estimate")
  
})
adw96/breakaway documentation built on Dec. 12, 2023, 2:19 a.m.