Skip to content

Commit 8f20701

Browse files
committed
LLM suggested fix for failing windows tests
1 parent cb6d218 commit 8f20701

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

tests/testthat/test-model-compile-user_header.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test_that("cmdstan_model works with user_header with mock", {
4040

4141
with_mocked_cli(
4242
compile_ret = list(status = 0),
43-
info_ret = list(),
43+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
4444
code = expect_mock_compile(
4545
mod <- cmdstan_model(
4646
stan_file = testing_stan_file("bernoulli_external"),
@@ -52,7 +52,7 @@ test_that("cmdstan_model works with user_header with mock", {
5252

5353
with_mocked_cli(
5454
compile_ret = list(status = 0),
55-
info_ret = list(),
55+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
5656
code = expect_mock_compile({
5757
mod_2 <- cmdstan_model(
5858
stan_file = testing_stan_file("bernoulli_external"),
@@ -67,7 +67,7 @@ test_that("cmdstan_model works with user_header with mock", {
6767
file.create(file_that_exists)
6868
with_mocked_cli(
6969
compile_ret = list(status = 0),
70-
info_ret = list(),
70+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
7171
code = expect_no_mock_compile({
7272
mod$compile(quiet = TRUE, user_header = tmpfile)
7373
})
@@ -76,7 +76,7 @@ test_that("cmdstan_model works with user_header with mock", {
7676
Sys.setFileTime(tmpfile, Sys.time() + 1) # touch file to trigger recompile
7777
with_mocked_cli(
7878
compile_ret = list(status = 0),
79-
info_ret = list(),
79+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
8080
code = expect_mock_compile({
8181
mod$compile(quiet = TRUE, user_header = tmpfile)
8282
})
@@ -88,7 +88,7 @@ test_that("cmdstan_model works with user_header with mock", {
8888
# Alternative spec of user header
8989
with_mocked_cli(
9090
compile_ret = list(status = 0),
91-
info_ret = list(),
91+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
9292
code = expect_no_mock_compile({
9393
mod$compile(
9494
quiet = TRUE,
@@ -101,7 +101,7 @@ test_that("cmdstan_model works with user_header with mock", {
101101
# Error/warning messages
102102
with_mocked_cli(
103103
compile_ret = list(status = 1),
104-
info_ret = list(),
104+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
105105
code = expect_error(
106106
cmdstan_model(
107107
stan_file = testing_stan_file("bernoulli_external"),
@@ -114,7 +114,7 @@ test_that("cmdstan_model works with user_header with mock", {
114114

115115
with_mocked_cli(
116116
compile_ret = list(status = 1),
117-
info_ret = list(),
117+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
118118
code = expect_warning(
119119
cmdstan_model(
120120
stan_file = testing_stan_file("bernoulli_external"),
@@ -126,7 +126,7 @@ test_that("cmdstan_model works with user_header with mock", {
126126
)
127127
with_mocked_cli(
128128
compile_ret = list(status = 1),
129-
info_ret = list(),
129+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
130130
code = expect_warning(
131131
cmdstan_model(
132132
stan_file = testing_stan_file("bernoulli_external"),
@@ -144,7 +144,7 @@ test_that("wsl path conversion is done as expected", {
144144
# Case 1: arg
145145
with_mocked_cli(
146146
compile_ret = list(status = 1),
147-
info_ret = list(),
147+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
148148
code = {
149149
mod <- cmdstan_model(
150150
stan_file = testing_stan_file("bernoulli_external"),
@@ -162,7 +162,7 @@ test_that("wsl path conversion is done as expected", {
162162
# Case 2: cpp opt USER_HEADER
163163
with_mocked_cli(
164164
compile_ret = list(status = 1),
165-
info_ret = list(),
165+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
166166
code = {
167167
mod <- cmdstan_model(
168168
stan_file = testing_stan_file("bernoulli_external"),
@@ -182,7 +182,7 @@ test_that("wsl path conversion is done as expected", {
182182
# Case # 3: only user_header opt
183183
with_mocked_cli(
184184
compile_ret = list(status = 1),
185-
info_ret = list(),
185+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
186186
code = {
187187
mod <- cmdstan_model(
188188
stan_file = testing_stan_file("bernoulli_external"),
@@ -211,7 +211,7 @@ test_that("user_header precedence order is correct", {
211211
# Case # 1: all 3 specified
212212
with_mocked_cli(
213213
compile_ret = list(status = 1),
214-
info_ret = list(),
214+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
215215
code = expect_warning({
216216
mod <- cmdstan_model(
217217
stan_file = testing_stan_file("bernoulli_external"),
@@ -240,7 +240,7 @@ test_that("user_header precedence order is correct", {
240240
# Case # 2: Both opts, but no arg
241241
with_mocked_cli(
242242
compile_ret = list(status = 1),
243-
info_ret = list(),
243+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
244244
code = expect_warning({
245245
mod <- cmdstan_model(
246246
stan_file = testing_stan_file("bernoulli_external"),
@@ -268,7 +268,7 @@ test_that("user_header precedence order is correct", {
268268
# Case # 3: Both opts, other order
269269
with_mocked_cli(
270270
compile_ret = list(status = 1),
271-
info_ret = list(),
271+
info_ret = list(status = 0, stdout = "stan_version_major=2\nstan_version_minor=35\nstan_version_patch=0"),
272272
code = expect_warning({
273273
mod <- cmdstan_model(
274274
stan_file = testing_stan_file("bernoulli_external"),

0 commit comments

Comments
 (0)