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
{{ message }}
Repository navigation
MatchYAML compares only the first document of a multi-document YAML stream #933
This is another bug found by our automated process of writing hegel tests in hegel-zoo, filed as asked in #925 and, as before, reviewed by hand first.
MatchYAML reports a match when the actual YAML is a stream whose first document equals the expected: a: 1 matches a: 1\n---\nb: 2, and two streams that differ only in their second document match each other, while the same difference in the first document is caught:
I expected the first two to be false, or for a stream with more than one document to be rejected the way invalid YAML is; as it stands the second and later documents are accepted and then have no effect on the result.
Tested on v1.43.1, which is also the current master (47f0f87).
I've delegated fixing this to Claude and checked the code it generated. Thanks for reporting!
MatchYAML now decodes every document in the stream and compares them pairwise. Streams with different numbers of documents fail to match, and the failure message names the first mismatched document. Single documents behave exactly as before, and empty documents (such as a leading or trailing ---) are ignored. (2773796)
Activity
onsi commentedon Sep 24, 2026
I've delegated fixing this to Claude and checked the code it generated. Thanks for reporting!
MatchYAMLnow decodes every document in the stream and compares them pairwise. Streams with different numbers of documents fail to match, and the failure message names the first mismatched document. Single documents behave exactly as before, and empty documents (such as a leading or trailing---) are ignored. (2773796)This will be released in v1.44.0.