tests/testthat/test-create_future-rt.R

test_that("create_future_rt works as expected", {
  test_frt <- function(test, true) {
    expect_equal(test$from, true$from)
    expect_equal(test$fixed, true$fixed)
  }

  test_frt(EpiNow2:::create_future_rt(), list(fixed = TRUE, from = 0))
  test_frt(EpiNow2:::create_future_rt("project"), list(fixed = FALSE, from = 0))
  test_frt(EpiNow2:::create_future_rt("est", 10), list(fixed = TRUE, from = -10))
  test_frt(EpiNow2:::create_future_rt(-3), list(fixed = TRUE, from = -3))
  test_frt(EpiNow2:::create_future_rt(3), list(fixed = TRUE, from = 3))
})

Try the EpiNow2 package in your browser

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

EpiNow2 documentation built on Sept. 26, 2023, 5:11 p.m.