@@ -406,6 +406,15 @@ test_that("check_syntax() works with include_paths", {
406
406
407
407
})
408
408
409
+ test_that(" check_syntax() works with include_paths on compiled model" , {
410
+ stan_program_w_include <- testing_stan_file(" bernoulli_include" )
411
+
412
+ mod_w_include <- cmdstan_model(stan_file = stan_program_w_include , compile = TRUE ,
413
+ include_paths = test_path(" resources" , " stan" ))
414
+ expect_true(mod_w_include $ check_syntax())
415
+
416
+ })
417
+
409
418
test_that(" check_syntax() works with pedantic=TRUE" , {
410
419
model_code <- "
411
420
transformed data {
@@ -741,6 +750,28 @@ test_that("format() works with include_paths", {
741
750
)
742
751
})
743
752
753
+ test_that(" format() works with include_paths on compiled model" , {
754
+ stan_program_w_include <- testing_stan_file(" bernoulli_include" )
755
+
756
+ mod_w_include <- cmdstan_model(stan_file = stan_program_w_include , compile = TRUE ,
757
+ include_paths = test_path(" resources" , " stan" ))
758
+ expect_output(
759
+ mod_w_include $ format(),
760
+ " #include " ,
761
+ fixed = TRUE
762
+ )
763
+ expect_output(
764
+ mod_w_include $ format(canonicalize = list (' deprecations' , ' parentheses' , ' braces' )),
765
+ " #include " ,
766
+ fixed = TRUE
767
+ )
768
+ expect_output(
769
+ mod_w_include $ format(canonicalize = list (' includes' )),
770
+ " real divide_real_by_two" ,
771
+ fixed = TRUE
772
+ )
773
+ })
774
+
744
775
test_that(" overwrite_file works with format()" , {
745
776
code <- "
746
777
parameters {
0 commit comments