tests/testthat/test-utils-stancode.R

test_that("model with only prior sampling (no ODE solving) can be created", {
  par <- stan_param(stan_var("dummy"), "normal(0,1)")
  gq <- stan_transform(stan_var("foo"),
    origin = "model",
    code = "2*dummy"
  )
  odefun_vars <- list(par)
  other_vars <- list(gq)
  expect_output(par$print())
  expect_output(gq$print())
  code <- generate_stancode_prior(odefun_vars, list(), other_vars, FALSE)
  expect_gt(nchar(code$code), 30)
})
jtimonen/odemodeling documentation built on Sept. 15, 2024, 4:29 a.m.