Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

copybara-service[bot]
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
1 check passed
@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