From a156adde0e7194b0f651c815dad22b2ec5df835e Mon Sep 17 00:00:00 2001 From: "alex.hill@gmail.com" Date: Mon, 7 Oct 2024 22:37:46 +0100 Subject: [PATCH] test relative and absolute dates give same answers --- tests/testthat/test-relative-dates.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-relative-dates.R b/tests/testthat/test-relative-dates.R index cb844ed..b4710a1 100644 --- a/tests/testthat/test-relative-dates.R +++ b/tests/testthat/test-relative-dates.R @@ -18,11 +18,12 @@ test_that("Using relative and absolute dates gives the same answer", { iter_sampling = 100, seed = 100) - min_date <- min(dat_absolute$day) - set.seed(1) trajectories_relative <- mod_relative$simulate_individual_trajectories() - trajectories_relative$calendar_day <- as.integer(mindate + trajectories_relative$calendar_day, units = "days") + + # convert relative days to absolute + min_date <- min(dat_absolute$day) + trajectories_relative$calendar_day <- min_date + trajectories_relative$calendar_day expect_equal(trajectories_relative, trajectories_absolute) })