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

Function TEST_P

parser/parser_benchmarks.cc:237–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235class BenchmarkCaseTest : public testing::TestWithParam<TestInfo> {};
236
237TEST_P(BenchmarkCaseTest, ExpectedResult) {
238 std::vector<Macro> macros = Macro::AllMacros();
239 macros.push_back(cel::OptMapMacro());
240 macros.push_back(cel::OptFlatMapMacro());
241 const TestInfo& test_info = GetParam();
242 ParserOptions options;
243 options.enable_optional_syntax = true;
244 options.enable_quoted_identifiers = true;
245
246 auto result = EnrichedParse(test_info.expr, macros, "<input>", options);
247 switch (test_info.result) {
248 case ParseResult::kSuccess:
249 ASSERT_THAT(result, IsOk());
250 break;
251 case ParseResult::kError:
252 ASSERT_THAT(result, Not(IsOk()));
253 break;
254 }
255}
256
257INSTANTIATE_TEST_SUITE_P(CelParserTest, BenchmarkCaseTest,
258 testing::ValuesIn(GetTestCases()));

Callers

nothing calls this directly

Calls 2

AllMacrosFunction · 0.85
EnrichedParseFunction · 0.85

Tested by

no test coverage detected