Skip to content

Commit

Permalink
Additional test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Sep 12, 2023
1 parent 5cf67f7 commit 66a3b58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-fit-mle.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test_that("time is reported after optimization", {

test_that("no error when checking estimates after failure", {
fit <- cmdstanr_example("schools", method = "optimize", seed = 123) # optim ålways fails for this
expect_silent(fit$summary()) # no error
expect_silent(fit$summary(include_failed = TRUE)) # no error
})

test_that("draws() works for different formats", {
Expand Down
18 changes: 7 additions & 11 deletions tests/testthat/test-model-compile.R
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,14 @@ test_that("check_syntax() works with pedantic=TRUE", {
"
stan_file <- write_stan_file(model_code)
mod_dep_warning <- cmdstan_model(stan_file, compile = FALSE)
expect_message(
expect_error(
mod_dep_warning$compile(),
"deprecated in the Stan language",
"An error occured during compilation! See the message above for more information.",
fixed = TRUE
)
expect_message(
expect_error(
mod_dep_warning$check_syntax(),
"deprecated in the Stan language",
"Syntax error found! See the message above for more information.",
fixed = TRUE
)
})
Expand Down Expand Up @@ -690,13 +690,9 @@ test_that("format() works", {
stan_file_tmp <- write_stan_file(code)
mod_1 <- cmdstan_model(stan_file_tmp, compile = FALSE)

expect_output(
expect_message(
mod_1$format(),
"is deprecated",
fixed = TRUE
),
"target += normal_log(y, 0, 1);",
expect_error(
mod_1$format(),
"Syntax error found! See the message above for more information.",
fixed = TRUE
)

Expand Down

0 comments on commit 66a3b58

Please sign in to comment.