Skip to content

Commit

Permalink
updated tests to use offspring_dist argument
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Dec 6, 2023
1 parent 5d27d89 commit 79f9ae9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tests/testthat/test-probability_contain.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ test_that("probability_contain works with <epidist>", {
)
expect_equal(
probability_contain(
num_init_infect = 1, control = 0.1, stochastic = FALSE, epidist = edist
num_init_infect = 1,
control = 0.1,
stochastic = FALSE,
offspring_dist = edist
),
0.904
)
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-probability_epidemic.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ test_that("probability_epidemic works with <epidist>", {
single_epidist = TRUE
)
)
expect_equal(probability_epidemic(num_init_infect = 1, epidist = edist), 0.12)
expect_equal(
probability_epidemic(num_init_infect = 1, offspring_dist = edist),
0.12
)
})

test_that("probability_epidemic fails without R and k or <epidist>", {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-proportion_cluster_size.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test_that("proportion_cluster_size works with <epidist>", {
single_epidist = TRUE
)
)
res <- proportion_cluster_size(cluster_size = 20, epidist = edist)
res <- proportion_cluster_size(cluster_size = 20, offspring_dist = edist)

expect_s3_class(res, "data.frame")
expect_identical(dim(res), c(1L, 3L))
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-proportion_transmission.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ test_that("proportion_transmission works with <epidist>", {
single_epidist = TRUE
)
)
res <- proportion_transmission(percent_transmission = 0.8, epidist = edist)
res <- proportion_transmission(
percent_transmission = 0.8,
offspring_dist = edist
)

expect_s3_class(res, "data.frame")
expect_identical(dim(res), c(1L, 3L))
Expand Down

0 comments on commit 79f9ae9

Please sign in to comment.