| 176 | }); |
| 177 | |
| 178 | TEST_F(StandardLibraryDefinitionsTest, DefinesProtoStructNull) { |
| 179 | auto ast = std::make_unique<Ast>(); |
| 180 | |
| 181 | auto& enumerator = ast->mutable_root_expr(); |
| 182 | enumerator.set_id(4); |
| 183 | enumerator.mutable_select_expr().set_field("NULL_VALUE"); |
| 184 | auto& enumeration = enumerator.mutable_select_expr().mutable_operand(); |
| 185 | enumeration.set_id(3); |
| 186 | enumeration.mutable_select_expr().set_field("NullValue"); |
| 187 | auto& protobuf = enumeration.mutable_select_expr().mutable_operand(); |
| 188 | protobuf.set_id(2); |
| 189 | protobuf.mutable_select_expr().set_field("protobuf"); |
| 190 | auto& google = protobuf.mutable_select_expr().mutable_operand(); |
| 191 | google.set_id(1); |
| 192 | google.mutable_ident_expr().set_name("google"); |
| 193 | |
| 194 | ASSERT_OK_AND_ASSIGN(ValidationResult result, |
| 195 | stdlib_type_checker_->Check(std::move(ast))); |
| 196 | |
| 197 | EXPECT_THAT(result.GetIssues(), IsEmpty()); |
| 198 | ASSERT_OK_AND_ASSIGN(std::unique_ptr<Ast> checked_ast, result.ReleaseAst()); |
| 199 | EXPECT_THAT(checked_ast->GetReference(4), |
| 200 | Pointee(Property(&Reference::name, |
| 201 | "google.protobuf.NullValue.NULL_VALUE"))); |
| 202 | } |
| 203 | |
| 204 | TEST_F(StandardLibraryDefinitionsTest, DefinesTypeType) { |
| 205 | auto ast = std::make_unique<Ast>(); |
nothing calls this directly
no test coverage detected