tests/testthat/test-half_life.R

hl <- half_life(0.01)
test_that("half_life returns a single numeric value", {
  expect_length(hl, 1L)
  expect_equal(class(hl), "numeric")
})

test_that("half_life throw an error when lambda is not numeric & > 1", {
  expect_error(half_life("1"))
  expect_error(half_life(c(0.01, 0.01)))

})

Try the ffp package in your browser

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

ffp documentation built on Sept. 29, 2022, 5:10 p.m.