diff --git a/tests/testthat/test-extra-time.R b/tests/testthat/test-extra-time.R index e3994e150..35d77c01e 100644 --- a/tests/testthat/test-extra-time.R +++ b/tests/testthat/test-extra-time.R @@ -47,7 +47,6 @@ test_that("extra_time, newdata, get_index() work", { family = tweedie(link = "log"), time = "year", spatial = "off", - # mesh = make_mesh(pcod, c("X", "Y"), n_knots = 25), spatiotemporal = "off", extra_time = c(2006, 2008, 2010, 2012, 2014, 2016, 2018) # last real year is 2017 ) @@ -82,4 +81,11 @@ test_that("extra_time, newdata, get_index() work", { p$fake_nd <- NULL # mimic old sdmTMB expect_error(ind4 <- get_index(p)) + + # missing some original time: + nd <- replicate_df(pcod, "year", unique(pcod$year)) + nd <- subset(nd, year != 2017) + p <- predict(m, newdata = nd, return_tmb_object = TRUE) + ind5 <- get_index(p) + expect_equal(ind2[ind2$year %in% nd$year, "est"], ind5[ind5$year %in% nd$year, "est"]) })