simulate a program of: a / \ // b c
| 92 | // / \ |
| 93 | // b c |
| 94 | absl::StatusOr<SimpleTreeSteps> InitSimpleTree( |
| 95 | const Expr& a, const Expr& b, const Expr& c, |
| 96 | ProgramBuilder& program_builder) { |
| 97 | CEL_ASSIGN_OR_RETURN(auto a_step, CreateConstValueStep(cel::NullValue(), -1)); |
| 98 | CEL_ASSIGN_OR_RETURN(auto b_step, CreateConstValueStep(cel::NullValue(), -1)); |
| 99 | CEL_ASSIGN_OR_RETURN(auto c_step, CreateConstValueStep(cel::NullValue(), -1)); |
| 100 | |
| 101 | SimpleTreeSteps result{a_step.get(), b_step.get(), c_step.get()}; |
| 102 | |
| 103 | program_builder.EnterSubexpression(&a); |
| 104 | program_builder.EnterSubexpression(&b); |
| 105 | program_builder.AddStep(std::move(b_step)); |
| 106 | program_builder.ExitSubexpression(&b); |
| 107 | program_builder.EnterSubexpression(&c); |
| 108 | program_builder.AddStep(std::move(c_step)); |
| 109 | program_builder.ExitSubexpression(&c); |
| 110 | program_builder.AddStep(std::move(a_step)); |
| 111 | program_builder.ExitSubexpression(&a); |
| 112 | |
| 113 | return result; |
| 114 | } |
| 115 | |
| 116 | TEST_F(PlannerContextTest, GetPlan) { |
| 117 | Expr a; |