diff --git a/tests/testthat/test-fit-mle.R b/tests/testthat/test-fit-mle.R index 40fddc2b..f5828a60 100644 --- a/tests/testthat/test-fit-mle.R +++ b/tests/testthat/test-fit-mle.R @@ -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", { diff --git a/tests/testthat/test-model-compile.R b/tests/testthat/test-model-compile.R index 3134bbc0..8fae1a02 100644 --- a/tests/testthat/test-model-compile.R +++ b/tests/testthat/test-model-compile.R @@ -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 ) }) @@ -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 )