Skip to content

Commit

Permalink
updated probability_contain test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Jan 29, 2024
1 parent a30fa41 commit f5b206e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 0 additions & 7 deletions tests/testthat/_snaps/probability_contain.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@
"value": [0.7636]
}

# probability_contain works as when using dots with incorrect name

Code
probability_contain(R = 1.5, k = 0.5, num_init_infect = 1, random = 100)
Output
[1] 0.7675919

# probability_contain works with <epidist>

Code
Expand Down
13 changes: 7 additions & 6 deletions tests/testthat/test-probability_contain.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ test_that("probability_contain works as when using dots", {
)
})

test_that("probability_contain works as when using dots with incorrect name", {
expect_snapshot(
probability_contain(R = 1.5, k = 0.5, num_init_infect = 1, random = 100)
)
})

test_that("probability_contain works with <epidist>", {
skip_if_not_installed(pkg = "epiparameter")
edist <- suppressMessages(
Expand Down Expand Up @@ -147,6 +141,13 @@ test_that("probability_contain fails as expected", {
)
})

test_that("probability_contain fails using dots with incorrect name", {
expect_error(
probability_contain(R = 1.5, k = 0.5, num_init_infect = 1, random = 100),
regexp = "Arguments supplied in `...` not valid"
)
})

test_that("probability_contain fails without R and k or <epidist>", {
expect_error(
probability_contain(num_init_infect = 1, pop_control = 0.5),
Expand Down

0 comments on commit f5b206e

Please sign in to comment.