| 273 | })); |
| 274 | |
| 275 | TEST(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 | |
| 287 | struct ListCheckerTestCase { |
| 288 | std::string expr; |
nothing calls this directly
no test coverage detected