Skip to content

Fix verifier cleanup composition, stream/xml disposal and comparison#1771

Merged
SimonCropp merged 2 commits into
mainfrom
Fix-verifier-cleanup-composition,-stream/xml-disposal-and-comparison
Jul 5, 2026
Merged

Fix verifier cleanup composition, stream/xml disposal and comparison#1771
SimonCropp merged 2 commits into
mainfrom
Fix-verifier-cleanup-composition,-stream/xml-disposal-and-comparison

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

No description provided.

SimonCropp and others added 2 commits July 5, 2026 23:04
- Compose async cleanups with a Then helper so both are awaited; `+=` on a
  Func<Task> builds a multicast delegate that only awaits the last target, so
  converter/user async cleanups were fire-and-forget
- Run cleanup in a finally around HandleResults so it still runs when the
  comparison throws
- IsAutoVerify: only gate the global autoVerify delegate on typeName, so the
  per-settings delegate works for the file-level InnerVerifier(directory, name)
- VerifyXml(Stream) disposes the stream, matching the other stream APIs
- Comparer.Text reads the verified file with VerifierSettings.Encoding so a
  BOM-less non-UTF8 UseEncoding round-trips (writes already use it)
- StreamComparer rents its buffers from ArrayPool and compares exactly the
  bytes read via SequenceEqual (a rented buffer's trailing bytes are arbitrary)
- Add tests for the above
@SimonCropp SimonCropp added this to the 31.21.0 milestone Jul 5, 2026
@SimonCropp SimonCropp merged commit b514fa9 into main Jul 5, 2026
5 of 6 checks passed
@SimonCropp SimonCropp deleted the Fix-verifier-cleanup-composition,-stream/xml-disposal-and-comparison branch July 5, 2026 13:20
This was referenced Jul 6, 2026
This was referenced Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants