Skip to content

assert.YAMLEq: Document mutlidoc behavior#1791

Merged
brackendawson merged 4 commits into
stretchr:masterfrom
brackendawson:YAMLEq-document-multidoc
Sep 13, 2025
Merged

assert.YAMLEq: Document mutlidoc behavior#1791
brackendawson merged 4 commits into
stretchr:masterfrom
brackendawson:YAMLEq-document-multidoc

Conversation

@brackendawson
Copy link
Copy Markdown
Collaborator

@brackendawson brackendawson commented Sep 11, 2025

Summary

Document the limitation that YAMLEq only compares the first document.

Changes

  • Add tests to cover more of the current YAMLEq behavior.
  • Document that YAMLEq only compares the first document.

Motivation

It would be preferable to fix YAMLEq to compare all documents because that's what it outwardly claims to do and is what one would expect it to do. #1284 would do that, but #1579 as made this practically impossible. So in testify v1 we must document the behavior as is.

Related issues

Addresses but does not resolve #1281

* Identical but invalid YAML is an assertion error.
* Subsequent documents are unchecked.
@brackendawson brackendawson force-pushed the YAMLEq-document-multidoc branch from 8ea0b9a to a78e373 Compare September 11, 2025 07:29
@brackendawson brackendawson changed the title Yaml eq document multidoc assery.YAMLEq: Document mutlidoc behavior Sep 11, 2025
@brackendawson brackendawson changed the title assery.YAMLEq: Document mutlidoc behavior assert.YAMLEq: Document mutlidoc behavior Sep 11, 2025
Comment thread assert/assertions.go Outdated
Comment thread assert/assertions.go Outdated
Comment thread assert/assertions.go Outdated
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
@brackendawson brackendawson force-pushed the YAMLEq-document-multidoc branch from aa34525 to 2b945c3 Compare September 12, 2025 07:15
Comment thread assert/assertions.go
@brackendawson brackendawson merged commit 5fa984a into stretchr:master Sep 13, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YAMLEq: multi documents are not checked

2 participants