Open christopher-taormina-zocdoc opened 1 year ago
I expect this is related to go-difflib so #1327 is probably relevant.
Could we make this configurable / a global option? https://github.com/stretchr/testify/blob/1b4fca7679ac5ddaf45491840c8a0cace9fc6d83/assert/assertions.go#L1890
Happy to open a PR
Is it possible to adjust the amount of context lines around the offending lines in a diff?
I'm asserting on some structs that I don't fully own, and the diffs when using
assert.EqualValues
end up leaving out crucial information on which value needs to change, just that the value is different. Given the following exampleThe test will spit out the following message when it fails.
From the output, knowing the specific entry in the
KeyValues
slice is not really possible. Obviously in this example there's only one element, but once more are added, it becomes increasingly difficult to figure out exactly which entry in the slice is causing the issue, especially if values end up duplicated for whatever reasons.