tests/testthat/test-confint_binom.R

test_that("calls check_args_binom", {
	expect_error(confint_binom(n = 10, N = 9), class = "domain_error")
})

test_that("Accepts default arguments", {
	expect_error(confint_binom(n = 50, N = 100), NA)
})

test_that("Returns a numeric vector of length two", {
	res <- confint_binom(1, 2)

	expect_type(res, "double")
	expect_length(res, 2)
})

test_that("Has a cl attribute with the correct value", {
	cl <- 0.95
	res <- confint_binom(1, 2, cl = cl)

	expect_identical(attr(res, "cl"), cl)
})

Try the fcci package in your browser

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

fcci documentation built on Jan. 7, 2022, 5:27 p.m.