tests/testthat/test-match_output_arguments.R

test_that("match_output_arguments works as expected", {
  out <- rep(FALSE, 3)
  names(out) <- c("fit", "plots", "samples")
  expect_equal(
    EpiNow2:::match_output_arguments(supported_args = names(out)),
    out
  )
  out["plots"] <- TRUE
  expect_equal(
    EpiNow2:::match_output_arguments("plots", supported_args = names(out)), out
  )
  out["samples"] <- TRUE
  expect_equal(EpiNow2:::match_output_arguments(c("plots", "samples"),
    supported_args = names(out)
  ), out)
  expect_equal(
    EpiNow2:::match_output_arguments("p", supported_args = names(out)), out
  )
})

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.