Skip to content

Conversation

@copybara-service
Copy link

Add a test matcher for the elements of cel::ListValue and cel::MapValue.

Instead of manually unwrapping a list or map to test their contents, they can now be matched with ListValueElements and MapValueElements, e.g.:

ASSERT_THAT(l, ListValueIs(ListValueElements(&mgr, ElementsAre(x1, x2, ...)));

ASSERT_THAT(l, MapValueIs(MapValueElements(&mgr, UnorderedElementsAre(Pair(k1, v1), ...)));

Instead of manually unwrapping a list or map to test their contents, they can now be matched with ListValueElements and MapValueElements, e.g.:

ASSERT_THAT(l, ListValueIs(ListValueElements(&mgr, ElementsAre(x1, x2, ...)));

ASSERT_THAT(l, MapValueIs(MapValueElements(&mgr, UnorderedElementsAre(Pair(k1, v1), ...)));

PiperOrigin-RevId: 646514108
@copybara-service copybara-service bot merged commit fa439a3 into master Jun 25, 2024
@copybara-service copybara-service bot deleted the test_646191615 branch June 25, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant