From 6f8e23eb7b52e86a3a789a9d4f5a6615926ac41e Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Sun, 17 Sep 2023 20:42:08 +0200 Subject: [PATCH] add deprecation tests --- tests/testthat/test-delays.R | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/testthat/test-delays.R b/tests/testthat/test-delays.R index 8b3907607..a7917125a 100644 --- a/tests/testthat/test-delays.R +++ b/tests/testthat/test-delays.R @@ -104,3 +104,36 @@ test_that("contradictory delays are caught", { "must be 0" ) }) + +test_that("deprecated arguments are caught", { + expect_warning( + test_stan_delays( + generation_time = generation_time_opts(mean = 3), + params = delay_params + ), "deprecated" + ) + expect_error( + test_stan_delays( + delays = delay_opts(mean = 3), + params = delay_params + ), "named arguments" + ) + expect_warning( + test_stan_delays( + delays = delay_opts(list(mean = 3)), + params = delay_params + ), "deprecated" + ) + expect_warning( + test_stan_delays( + delays = delay_opts(list(mean = 3)), + params = delay_params + ), "deprecated" + ) + expect_warning( + test_stan_delays( + delays = trunc_opts(list(mean = 3)), + params = delay_params + ), "deprecated" + ) +})