Skip to content
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

Adapt EqualExportedValues to accept ptr types on top of struct types #1547

Conversation

redachl
Copy link

@redachl redachl commented Feb 22, 2024

Disclaimer: This is my first pull request on an open-source project.

Summary

This PR adapts the EqualExportedValues method to also handle pointer types, on top of struct types.

Changes

The function copyExportedFields already handles pointer types correctly. Therefore it is only necessary to make the validation include pointer types.
The added tests pass, which validates this hypothesis.

Motivation

It is useful for proto message equality. Using Equal often fails because unexported values of proto messages are different.

Related issues

Closes #758

@redachl
Copy link
Author

redachl commented Feb 22, 2024

Actually there's another PR doing this: #1517

@redachl redachl closed this Feb 22, 2024
@redachl redachl deleted the fix/assert-equal-exported-values-accepts-pointers-too branch February 22, 2024 16:28
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.

Support protobuf equality
1 participant