tests/testthat/test-stan-generated_quantities.R

skip_on_cran()
skip_on_os("windows")

test_that("calculate_growth works as expected", {
  skip_on_cran()
  expect_equal(calculate_growth(rep(1, 5), 1), rep(0, 4))
  expect_equal(round(calculate_growth(1:5, 2), 2), c(0.41, 0.29, 0.22))
  expect_equal(round(calculate_growth(exp(0.4*1:5), 2), 2), rep(0.4, 3))
  expect_error(calculate_growth(1:5, 6))
  expect_error(calculate_growth(1:5, 0))
})

Try the EpiNow2 package in your browser

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

EpiNow2 documentation built on Oct. 31, 2024, 5:09 p.m.