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

Function TEST_P

compiler/optional_test.cc:69–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69TEST_P(OptionalTest, OptionalsEnabled) {
70 const TestCase& test_case = GetParam();
71
72 ASSERT_OK_AND_ASSIGN(
73 auto builder,
74 NewCompilerBuilder(cel::internal::GetSharedTestingDescriptorPool()));
75 ASSERT_THAT(builder->AddLibrary(StandardCheckerLibrary()), IsOk());
76 ASSERT_THAT(builder->AddLibrary(OptionalCompilerLibrary()), IsOk());
77 ASSERT_THAT(builder->GetCheckerBuilder().AddVariable(MakeVariableDecl(
78 "msg", MessageType(TestAllTypes::descriptor()))),
79 IsOk());
80
81 ASSERT_OK_AND_ASSIGN(auto compiler, std::move(*builder).Build());
82
83 absl::StatusOr<ValidationResult> maybe_result =
84 compiler->Compile(test_case.expr);
85
86 ASSERT_OK_AND_ASSIGN(ValidationResult result, std::move(maybe_result));
87 ASSERT_TRUE(result.IsValid()) << FormatIssues(result);
88 EXPECT_EQ(FormatBaselineAst(*result.GetAst()),
89 absl::StripAsciiWhitespace(test_case.expected_ast))
90 << test_case.expr;
91}
92
93INSTANTIATE_TEST_SUITE_P(
94 OptionalTest, OptionalTest,

Callers

nothing calls this directly

Calls 15

StandardCheckerLibraryFunction · 0.85
OptionalCompilerLibraryFunction · 0.85
MakeVariableDeclFunction · 0.85
FormatBaselineAstFunction · 0.85
StandardCompilerLibraryFunction · 0.85
AddVariableMethod · 0.80
IsValidMethod · 0.80
GetAstMethod · 0.80
GetIssuesMethod · 0.80
FormatErrorMethod · 0.80
FormatIssuesFunction · 0.70
NewCompilerBuilderFunction · 0.70

Tested by

no test coverage detected