diff --git a/R/model.R b/R/model.R index e17ffbd4..c7391b33 100644 --- a/R/model.R +++ b/R/model.R @@ -2399,7 +2399,7 @@ model_compile_info <- function(exe_file) { if (!is.na(as.logical(val))) { val <- as.logical(val) } - info[[toupper(key_val[1])]] <- val + info[[tolower(key_val[1])]] <- val } } info[["STAN_VERSION"]] <- paste0(info[["STAN_VERSION_MAJOR"]], ".", info[["STAN_VERSION_MINOR"]], ".", info[["STAN_VERSION_PATCH"]]) diff --git a/tests/testthat/test-example.R b/tests/testthat/test-example.R index 8d14d5d0..157929e0 100644 --- a/tests/testthat/test-example.R +++ b/tests/testthat/test-example.R @@ -1,7 +1,7 @@ context("cmdstanr_example") test_that("cmdstanr_example works", { - fit_mcmc <- cmdstanr_example("logistic", chains = 2) + fit_mcmc <- cmdstanr_example("logistic", chains = 2, force_recompile = TRUE) checkmate::expect_r6(fit_mcmc, "CmdStanMCMC") expect_equal(fit_mcmc$num_chains(), 2) diff --git a/tests/testthat/test-model-compile.R b/tests/testthat/test-model-compile.R index 2be8390f..ba730345 100644 --- a/tests/testthat/test-model-compile.R +++ b/tests/testthat/test-model-compile.R @@ -496,7 +496,7 @@ test_that("cpp_options work with settings in make/local", { rebuild_cmdstan() mod <- cmdstan_model(stan_file = stan_program) - expect_null(mod$cpp_options()$STAN_THREADS) + expect_null(mod$cpp_options()$stan_threads) file.remove(mod$exe_file()) @@ -504,7 +504,7 @@ test_that("cpp_options work with settings in make/local", { file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan") mod <- cmdstan_model(file) - expect_true(mod$cpp_options()$STAN_THREADS) + expect_true(mod$cpp_options()$stan_threads) file.remove(mod$exe_file()) @@ -789,6 +789,8 @@ test_that("overwrite_file works with format()", { } " stan_file_tmp <- write_stan_file(code) + on.exit(file.remove(stan_file_tmp)) + mod_1 <- cmdstan_model(stan_file_tmp, compile = FALSE) expect_false( any(