diff --git a/tests/testthat/answers/model-print-output.stan b/tests/testthat/answers/model-print-output.stan index 0b04c379c..3b6099fcc 100644 --- a/tests/testthat/answers/model-print-output.stan +++ b/tests/testthat/answers/model-print-output.stan @@ -1,11 +1,11 @@ - 1: data { - 2: int N; - 3: array[N] int y; - 4: } - 5: parameters { - 6: real theta; - 7: } - 8: model { - 9: theta ~ beta(1, 1); // uniform prior on interval 0,1 -10: y ~ bernoulli(theta); -11: } +data { + int N; + array[N] int y; +} +parameters { + real theta; +} +model { + theta ~ beta(1, 1); // uniform prior on interval 0,1 + y ~ bernoulli(theta); +} diff --git a/tests/testthat/test-model-code-print.R b/tests/testthat/test-model-code-print.R index 09f8eb19e..e3409ed97 100644 --- a/tests/testthat/test-model-code-print.R +++ b/tests/testthat/test-model-code-print.R @@ -50,16 +50,16 @@ test_that("code() doesn't change when file changes (unless model is recreated)", mod <- cmdstan_model(stan_file_1, compile = FALSE) expect_identical(mod$code(), code_1_answer) - code_1_print <- utils::capture.output(mod$print()) + expect_identical(utils::capture.output(mod$print()), code_1_answer) # overwrite with new code, but mod$code() shouldn't change file.copy(stan_file_2, stan_file_1, overwrite = TRUE) expect_identical(mod$code(), code_1_answer) - expect_identical(utils::capture.output(mod$print()), code_1_print) # recreate CmdStanModel object, now mod$code() should change mod <- cmdstan_model(stan_file_1, compile = FALSE) expect_identical(mod$code(), code_2_answer) + expect_identical(utils::capture.output(mod$print()), code_2_answer) }) test_that("code() warns and print() errors if only exe and no Stan file", {