gotestyourself / gotestyourself/gotest.tools
Allow specifying default deep-equality comparison options?
- Dominant language
- Go
- Stars
- 576
- Forks
- 54
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 2
Description
I originally tried pitching this to go-cmp, and they said no because they quite resonably want all comparison to be stateless.
https://github.com/google/go-cmp/issues/241#issue-736205887
The context from that issue is:
> After upgrading to the most recent version of protobuf, we are finding all of our comparisons are failing due to some new unexported fields.
>
> There is a cmp.Option implementation provided by the protobuf module in godoc.org/google.golang.org/protobuf/testing/protocmp#Transform - but I now need to go and add this option to every single compare.
>
> This particular check is generic and safe to add on every compare - would it be reasonable to provide a way to install such global comparison options?
This feels like it might be slightly safer for a test assertion tool, as each "global" would be scoped to the test binary.
Contributor guide
Assessment
This issue has not been assessed yet.