-
Notifications
You must be signed in to change notification settings - Fork 451
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
Recommendations for test helpers to compare outputs? #1141
Comments
We don't currently have any api for recursively comparing messages. The Visitor interface isn't really going to work for this since it gets called by the message as it walks the field, so it wouldn't be able to walk two messages in parallel to compare things. You might be able to build something for it, but you'd have to build up some sorta journal from the walk, and then walk the second message and try to compare against the journal. |
Thanks for the info! Should I keep this open as a feature request? |
Three ideas come to mind:
|
In my tests, I often compare the (protobuf message) output of a function with an expected result created via e.g.
Message.with { }
. However,XCTAssertEqual
will output the full string representation of both messages in case of a mismatch, which makes it hard to spot the difference.Do you have any recommendations on e.g. only outputting the fields that are different? I had a cursory look at this project, but am unsure whether implementing
PBTestVisitor
is the recommended approach.The text was updated successfully, but these errors were encountered: