chore: add test for embedded IsZero() implementer #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had a failing test in a project I'm working on that I tracked down to what I think is a bug in https://github.com/alecthomas/repr. However, it was exposed by my use of
assertand I managed to find a simple reproducer test case that exposes the bug so I have sent the PR here.Basically, it looks like the change around
IsZero()in v0.5.x ofreprcauses a panic in some cases. I see that you have fixed one such case inv0.5.2ofrepr, but that doesn't fix the case that I found in this PR: when comparing a struct with a pointer member that is nil, but has an embedded type that implementsIsZero()(such astime.Time), it will panic.Reverting to
reprv0.4.0 allows this test case to pass.Please let me know if I can provide more info.
Here's the panic you get running this PR: