You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was initially filed as an issue on goconvey: smartystreets/goconvey#665
But really it's a problem in this assertions code.
Assuming you read that issue first, and especially smartystreets/goconvey#665 (comment) , the right fix would be for the diff to report which types are different. That would be a little involved, especially if anyone has managed to rely on the exact output format that is provided currently.
A lazier fix would be something like the below
funcShouldResemble(actualinterface{}, expected...interface{}) string {
ifmessage:=need(1, expected); message!=success {
returnmessage
}
ifmatchError:=oglematchers.DeepEquals(expected[0]).Matches(actual); matchError!=nil {
renderedExpected, renderedActual:=render.Render(expected[0]), render.Render(actual)
message:=fmt.Sprintf(shouldHaveResembled, renderedExpected, renderedActual)
ifrenderedExpected!=renderedActual {
message+=composePrettyDiff(renderedExpected, renderedActual)
} else {
message+="No visual diff, but there is a difference in type within expected versus actual"
}
returnserializer.serializeDetailed(expected[0], actual, message)
}
returnsuccess
}
Currently ShouldResemble fails confusingly when the visual diff of
two items is the same despite DeepEquals being false.
See more context in comments in the PR, or at these issues
smarty#50smartystreets/goconvey#665
> Render doesn't show the types of fields, so something like int(5) will appear
the same as int64(5), but they will cause DeepEquals to return false. This
message at least makes it clear why there appears to be no diff. A better solution
would be to have the diff look for where the two items actually differ, e.g. through
something like https://github.com/go-test/deep
See PR #51 and Issue #50
This was initially filed as an issue on goconvey: smartystreets/goconvey#665
But really it's a problem in this assertions code.
Assuming you read that issue first, and especially smartystreets/goconvey#665 (comment) , the right fix would be for the diff to report which types are different. That would be a little involved, especially if anyone has managed to rely on the exact output format that is provided currently.
A lazier fix would be something like the below
FYI @riannucci
The text was updated successfully, but these errors were encountered: