From 5f77fb4bbc4c5da3519ad84c665e6135433beba1 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" + ) +})