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

Function TEST

extensions/lists_functions_test.cc:275–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273 }));
274
275TEST(ListsFunctionsTest, ListSortByMacroParseError) {
276 ASSERT_OK_AND_ASSIGN(auto source,
277 cel::NewSource("100.sortBy(e, e)", "<input>"));
278 MacroRegistry macro_registry;
279 ParserOptions parser_options{.add_macro_calls = true};
280 ASSERT_THAT(RegisterListsMacros(macro_registry, parser_options), IsOk());
281 EXPECT_THAT(
282 google::api::expr::parser::Parse(*source, macro_registry, parser_options),
283 StatusIs(absl::StatusCode::kInvalidArgument,
284 HasSubstr("sortBy can only be applied to")));
285}
286
287struct ListCheckerTestCase {
288 std::string expr;

Callers

nothing calls this directly

Calls 2

RegisterListsMacrosFunction · 0.85
ParseFunction · 0.50

Tested by

no test coverage detected