-
Notifications
You must be signed in to change notification settings - Fork 1.7k
assert.YAMLEq: handle multi documents #1284
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
Conversation
cb9bb69 to
f229450
Compare
dolmen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please rebase on master.
f229450 to
75989b6
Compare
In YAMLEq(), yaml documents in the input after the first document were silently not considered in the comparison. Make it compare all the docs. I checked JSONEq() and it always fails if you try to pass it JSON Lines documents, even if they are the same.
|
Related: #1755 (also changes YAMLEq) |
|
This patch has been broken by #1579 which made the YAML library pluggable. Updating the patch requires changing the interface for pluggable YAML lib as |
|
Because #1579 exposed the internal implementation of YAMLEq on testify's API, it is not possible to solve this issue without either partially implementing a YAML parser in testify itself or changing testify's API in one of two ways:
I'm closing this PR because it's no longer tenable. |
Summary
In
YAMLEq(), yaml documents in the input after the first document were silently not considered in the comparison. Make it compare all the docs.I checked JSONEq() and it always fails if you try to pass it JSON Lines documents, even if they are the same.
Changes
yaml.Decoder.Decode()loop into a[]interface{}rather than ayaml.Unmarshal()into aninterface{}.Motivation
Unlike with passing JSON Lines inputs to
JSONEq(), which always fails, passing multiple YAML documents with differences after the first document intoYAMLEq()silently passes. 😱Related issues
Closes #1281