tests/testthat/test-utils-output.R

test_that(".get_module_output() deals with well-formatted input", {
  results <- c(1, 2, 3, -2, 0, 0)
  input_1 <- list(values = c(1, 1, 1, 1, 1), index_offset = 0)
  input_2 <- list(values = c(1, 1, 1, 1, 1), index_offset = -1)

  expect_identical(.get_module_output(results, input_1$index_offset), list(values = results, index_offset = 0))
  expect_identical(.get_module_output(results, input_2$index_offset), list(values = results, index_offset = -1))
  expect_identical(.get_module_output(results, input_2$index_offset, additional_offset = 3), list(values = results, index_offset = 2))
})
covid-19-Re/estimateR documentation built on Sept. 14, 2024, 5:49 a.m.