/** test whether model with specified name in path good parses successfully * * @param model_name Name of model to parse * @param folder Path to folder under src/test/test-models (default "good") * @param msgs Warning message */ bool is_parsable_folder(const std::string& model_name, const std::string folder = "good", std::ostream* msgs = 0) { std::string path("src/test/test-models/"); path += folder; path += "/"; path += model_name; path += ".stan"; return is_parsable(path,msgs); }
TEST(langParser,parsableBadPeriods) { EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_periods_data.stan"), std::invalid_argument); EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_periods_tdata.stan"), std::invalid_argument); EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_periods_params.stan"), std::invalid_argument); EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_periods_tparams.stan"), std::invalid_argument); EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_periods_gqs.stan"), std::invalid_argument); EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_periods_local.stan"), std::invalid_argument); }
TEST(parserFunctions, funsBad2_good) { is_parsable("src/test/test-models/bad/functions-bad2.stan",0, true); }
TEST(lang_parser,parsable_test_bad11) { EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad11.stan"), std::invalid_argument); }
TEST(lang_parser,good_trunc) { EXPECT_TRUE(is_parsable("src/test/test-models/bad/lang/good_trunc.stan")); }
TEST(lang_parser,good_local_var_array_size) { EXPECT_TRUE(is_parsable("src/test/test-models/bad/lang/good_local_var_array_size.stan")); }
TEST(lang_parser,good_intercept_var) { EXPECT_TRUE(is_parsable("src/test/test-models/bad/lang/good_intercept_var.stan")); }
TEST(langParser,declareVarWithSameNameAsModel) { EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_model_name_var.stan"), std::invalid_argument); }
TEST(lang_parser,parsable_test_good_fun_name) { EXPECT_TRUE(is_parsable("src/test/test-models/bad/lang/good_fun_name.stan")); }
TEST(lang_parser,parsable_test_bad_cov_exp_quad_len_rvec_param) { EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_cov_exp_quad_len_rvec_param.stan"), std::invalid_argument); }
TEST(lang_parser,good_matrix_ops) { EXPECT_TRUE(is_parsable("src/test/test-models/bad/lang/good_matrix_ops.stan")); }
TEST(lang_parser,parsable_test_bad_cov_exp_quad_sigma_data) { EXPECT_THROW(is_parsable("src/test/test-models/bad/lang/bad_cov_exp_quad_sigma_data.stan"), std::invalid_argument); }