| 212 | : public testing::TestWithParam<StandardLibraryConfigTestCase> {}; |
| 213 | |
| 214 | TEST_P(StandardLibraryConfigTest, StandardLibraryConfig) { |
| 215 | const StandardLibraryConfigTestCase& param = GetParam(); |
| 216 | Env env; |
| 217 | env.SetDescriptorPool(internal::GetSharedTestingDescriptorPool()); |
| 218 | |
| 219 | Config config; |
| 220 | ASSERT_THAT(config.SetStandardLibraryConfig(param.standard_library_config), |
| 221 | IsOk()); |
| 222 | env.SetConfig(config); |
| 223 | |
| 224 | ASSERT_OK_AND_ASSIGN(std::unique_ptr<Compiler> compiler, env.NewCompiler()); |
| 225 | |
| 226 | for (const std::string& expr : param.expected_valid_expressions) { |
| 227 | ASSERT_OK_AND_ASSIGN(auto result1, compiler->Compile(expr)); |
| 228 | EXPECT_THAT(result1.GetIssues(), IsEmpty()) |
| 229 | << "With config: " << param.standard_library_config |
| 230 | << ", expected no issues for expr: " << expr |
| 231 | << " but got: " << result1.FormatError(); |
| 232 | } |
| 233 | for (const std::string& expr : param.expected_invalid_expressions) { |
| 234 | ASSERT_OK_AND_ASSIGN(auto result1, compiler->Compile(expr)); |
| 235 | EXPECT_THAT(result1.GetIssues(), Not(IsEmpty())) |
| 236 | << "With config: " << param.standard_library_config |
| 237 | << ", expected compilation error for expr: " << expr << " but got: \'" |
| 238 | << result1.FormatError() << "\'"; |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | INSTANTIATE_TEST_SUITE_P( |
| 243 | StandardLibraryConfigTest, StandardLibraryConfigTest, |
nothing calls this directly
no test coverage detected