tests/testthat/test-fct_cumulate_for_days.R

test_that("accumulate_for_days works", {
  expect_equal(
    accumulate_for_days(c(1, 2, 3), 2),
    c(1, 3, 5, 3)
  )

  expect_equal(
    accumulate_for_days(c(1, 2, 3), 3),
    c(1, 3, 6, 5, 3)
  )

  expect_equal(
    accumulate_for_days(c(NA, 2, 3), 3),
    c(0, 2, 5, 5, 3)
  )
})
UBESP-DCTV/covid19ita documentation built on May 15, 2024, 10:40 a.m.