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
Fix verifier cleanup composition, stream/xml disposal and comparison (#1771)
* Fix verifier cleanup composition, stream/xml disposal and comparison
- 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
* Docs changes
---------
Co-authored-by: GitHub Action <action@github.com>
thrownew($@"Verified file must use \n line endings, but it contains a \r (carriage return). Path: {filePair.VerifiedPath}. See https://github.com/verifytests/verify#text-file-settings");
0 commit comments