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

Method ConversionRoundTripTest

common/ast_proto_test.cc:804–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802 : public testing::TestWithParam<ConversionRoundTripCase> {
803 public:
804 ConversionRoundTripTest() {
805 auto builder =
806 cel::NewCompilerBuilder(internal::GetTestingDescriptorPool()).value();
807 builder->AddLibrary(cel::StandardCompilerLibrary()).IgnoreError();
808 builder->AddLibrary(OptionalCompilerLibrary()).IgnoreError();
809 builder->AddLibrary(extensions::ComprehensionsV2CompilerLibrary())
810 .IgnoreError();
811 builder->GetCheckerBuilder().set_container("cel.expr.conformance.proto3");
812 builder->GetCheckerBuilder()
813 .AddVariable(MakeVariableDecl("ident", IntType()))
814 .IgnoreError();
815 builder->GetCheckerBuilder()
816 .AddVariable(MakeVariableDecl("map_ident", JsonMapType()))
817 .IgnoreError();
818 compiler_ = builder->Build().value();
819 }
820
821 absl::StatusOr<ParsedExpr> ParseToProto(absl::string_view expr) {
822 CEL_ASSIGN_OR_RETURN(auto source, cel::NewSource(expr));

Callers

nothing calls this directly

Calls 12

StandardCompilerLibraryFunction · 0.85
OptionalCompilerLibraryFunction · 0.85
MakeVariableDeclFunction · 0.85
JsonMapTypeFunction · 0.85
AddVariableMethod · 0.80
NewCompilerBuilderFunction · 0.50
IntTypeClass · 0.50
valueMethod · 0.45
AddLibraryMethod · 0.45
set_containerMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected