Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed May 22, 2024
1 parent 675979a commit e828453
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cmdstanr
Title: R Interface to 'CmdStan'
Version: 0.8.0
Version: 0.8.0.9000
Date: 2024-05-18
Authors@R:
c(person(given = "Jonah", family = "Gabry", role = "aut",
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test-model-expose-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,17 @@ test_that("Exposing functions with precompiled model gives meaningful error", {
fixed = TRUE
)
})

test_that("Functions with SUNDIALS/KINSOL methods link correctly", {
modcode <- "
functions {
vector dummy_functor(vector guess, vector theta, data array[] real tails, data array[] int x_i) {
return [1, 1]';
}
vector call_solver(vector guess, vector theta, data array[] real tails, data array[] int x_i) {
return algebra_solver_newton(dummy_functor, guess, theta, tails, x_i);
}
}"
mod <- cmdstan_model(write_stan_file(modcode), force_recompile=TRUE)
expect_no_error(mod$expose_functions())
})

0 comments on commit e828453

Please sign in to comment.