Skip to content

Commit

Permalink
Add tests for closures costs
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikunterwegs committed Dec 11, 2024
1 parent feb20ab commit 133db05
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/testthat/test-daedalus_rtm.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,35 @@ test_that("daedalus real-time modelling: downstream func compat", {
expect_no_condition(
get_costs(output, "total")
)

# costs with closures
output <- daedalus_rtm(
"GBR", infection,
response_strategy = "elimination",
response_time_start = 14, response_time_end = 60
)
expect_no_condition(
get_costs(output)
)
expect_no_condition(
get_costs(output, "domain")
)
expect_no_condition(
get_costs(output, "total")
)

output <- daedalus_rtm(
"GBR", list(infection, infection),
response_strategy = "elimination",
response_time_start = 14, response_time_end = 60
)
expect_no_condition(
lapply(output, get_costs)
)
expect_no_condition(
lapply(output, get_costs, "domain")
)
expect_no_condition(
lapply(output, get_costs, "total")
)
})

0 comments on commit 133db05

Please sign in to comment.