Skip to content

Commit

Permalink
Enhance test [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Dec 12, 2023
1 parent f3def1f commit 516244e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/testthat/test-extra-time.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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"])
})

0 comments on commit 516244e

Please sign in to comment.