From f5b206e188ffd0dbf9753c9575fb9b0e7982296d Mon Sep 17 00:00:00 2001 From: Joshua Lambert Date: Mon, 29 Jan 2024 10:15:28 +0000 Subject: [PATCH] updated probability_contain test --- tests/testthat/_snaps/probability_contain.md | 7 ------- tests/testthat/test-probability_contain.R | 13 +++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/testthat/_snaps/probability_contain.md b/tests/testthat/_snaps/probability_contain.md index c7f039a..8a63bf5 100644 --- a/tests/testthat/_snaps/probability_contain.md +++ b/tests/testthat/_snaps/probability_contain.md @@ -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 Code diff --git a/tests/testthat/test-probability_contain.R b/tests/testthat/test-probability_contain.R index 7745fe2..21477d1 100644 --- a/tests/testthat/test-probability_contain.R +++ b/tests/testthat/test-probability_contain.R @@ -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 ", { skip_if_not_installed(pkg = "epiparameter") edist <- suppressMessages( @@ -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 ", { expect_error( probability_contain(num_init_infect = 1, pop_control = 0.5),