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

Function TEST_F

extensions/select_optimization_test.cc:429–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427}
428
429TEST_F(SelectOptimizationTest, AstTransformSelect) {
430 ASSERT_OK_AND_ASSIGN(
431 std::unique_ptr<cel::Ast> ast,
432 CompileForTestCase(
433 "nested_test_all_types.child.payload.standalone_message.bb"));
434
435 SelectOptimizationAstUpdater updater;
436 EXPECT_THAT(updater.UpdateAst(context_, *ast), IsOk());
437
438 const auto& attr_call = ast->root_expr().call_expr();
439 EXPECT_EQ(attr_call.function(), "cel.@attribute");
440
441 ASSERT_THAT(attr_call.args(), SizeIs(2));
442
443 EXPECT_EQ(attr_call.args()[0].ident_expr().name(), "nested_test_all_types");
444
445 EXPECT_THAT(
446 attr_call.args()[1].list_expr().elements(),
447 ElementsAre(SelectFieldEntry(1, "child"), SelectFieldEntry(2, "payload"),
448 SelectFieldEntry(23, "standalone_message"),
449 SelectFieldEntry(1, "bb")));
450}
451
452TEST_F(SelectOptimizationTest, AstTransformSelectPresence) {
453 ASSERT_OK_AND_ASSIGN(

Callers

nothing calls this directly

Calls 15

CompileForTestCaseFunction · 0.85
TestBindLegacyMessageFunction · 0.85
AttributePatternClass · 0.85
SourceInfoClass · 0.85
argsMethod · 0.80
AddAstTransformMethod · 0.80
MakeEvaluatorStateMethod · 0.80
AddProgramOptimizerMethod · 0.80
SetMissingPatternsMethod · 0.80
set_functionMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.50

Tested by

no test coverage detected