Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Aug 23, 2023
1 parent 6cae03a commit 97d1142
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/testthat/test-model-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,16 @@ test_that("Variable skeleton returns correct dimensions for matrices", {
}")
mod <- cmdstan_model(stan_file, compile_model_methods = TRUE,
force_recompile = TRUE)
fit <- mod$sample(data = list(N = 4, K = 3), chains = 1,
N <- 4
K <- 3
fit <- mod$sample(data = list(N = N, K = K), chains = 1,
iter_warmup = 1, iter_sampling = 1)

target_skeleton <- list(
x_real = array(0, dim = 1),
x_mat = array(0, dim = c(4, 3)),
x_vec = array(0, dim = c(3)),
x_rowvec = array(0, dim = c(3))
x_mat = array(0, dim = c(N, K)),
x_vec = array(0, dim = K),
x_rowvec = array(0, dim = K)
)

expect_equal(fit$variable_skeleton(),
Expand Down

0 comments on commit 97d1142

Please sign in to comment.