| 153 | public testing::WithParamInterface<std::string> {}; |
| 154 | |
| 155 | TEST_P(StdlibTypeVarDefinitionTest, DefinesTypeConstants) { |
| 156 | auto ast = std::make_unique<Ast>(); |
| 157 | ast->mutable_root_expr().mutable_ident_expr().set_name(GetParam()); |
| 158 | ast->mutable_root_expr().set_id(1); |
| 159 | |
| 160 | ASSERT_OK_AND_ASSIGN(ValidationResult result, |
| 161 | stdlib_type_checker_->Check(std::move(ast))); |
| 162 | |
| 163 | EXPECT_THAT(result.GetIssues(), IsEmpty()); |
| 164 | ASSERT_OK_AND_ASSIGN(std::unique_ptr<Ast> checked_ast, result.ReleaseAst()); |
| 165 | EXPECT_THAT(checked_ast->GetReference(1), |
| 166 | Pointee(Property(&Reference::name, GetParam()))); |
| 167 | EXPECT_THAT(checked_ast->GetTypeOrDyn(1), Property(&AstType::has_type, true)); |
| 168 | } |
| 169 | |
| 170 | INSTANTIATE_TEST_SUITE_P(StdlibTypeVarDefinitions, StdlibTypeVarDefinitionTest, |
| 171 | ::testing::Values("bool", "bytes", "double", "dyn", |
nothing calls this directly
no test coverage detected