MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TEST_F

Function TEST_F

checker/standard_library_test.cc:178–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176 });
177
178TEST_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
204TEST_F(StandardLibraryDefinitionsTest, DefinesTypeType) {
205 auto ast = std::make_unique<Ast>();

Callers

nothing calls this directly

Calls 7

set_fieldMethod · 0.80
GetIssuesMethod · 0.80
ReleaseAstMethod · 0.80
GetReferenceMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.50
set_idMethod · 0.45
set_nameMethod · 0.45

Tested by

no test coverage detected