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
Commit f1bf84c
Browse filesBrowse the repository at this point in the historyBrowse files
Fix VerifySettings copy constructor, temp cleanup, and stream/extensi… (#1768)
* Fix VerifySettings copy constructor, temp cleanup, and stream/extension edge cases
- VerifySettings copy ctor: copy throwException (was dropped, so
settings.AutoVerify(throwException: true) passed as an instance silently
did not throw on mismatch)
- VerifySettings copy ctor: clone the mutable collections it was aliasing
(appendedFiles, the extension stream/string comparer dictionaries, and the
inner lists of ExtensionMappedInstanceScrubbers), so per-test fluent config
no longer leaks into a shared base settings instance
- TempDirectory/TempFile cleanup: catch IOException/UnauthorizedAccessException
for aged-out orphans instead of DirectoryNotFoundException/FileNotFoundException
(which File.Delete never throws), so a locked or read-only orphan no longer
fails the module initializer on every run
- IoHelpers.WriteStream: fall back to copying through the handle when File.Copy
cannot re-open the source by path (writable / FileShare.None, or a handle-based
stream), resetting position only in that fallback
- Extensions.Extension(FileStream): return "noextension" for extension-less
files instead of throwing ArgumentOutOfRangeException
- TempDirectory/TempFile: guard the AsyncLocal path list with a lock on
add/remove/scrub iteration
- Add tests for the above
* Docs changes
---------
Co-authored-by: GitHub Action <action@github.com>
<sup><ahref='/src/Verify.Tests/TempFileTests.cs#L727-L732'title='Snippet source file'>snippet source</a> | <ahref='#snippet-TempFileCreateBinaryWithExtension'title='Start of snippet'>anchor</a></sup>
356
+
<sup><ahref='/src/Verify.Tests/TempFileTests.cs#L776-L781'title='Snippet source file'>snippet source</a> | <ahref='#snippet-TempFileCreateBinaryWithExtension'title='Start of snippet'>anchor</a></sup>
357
357
<!-- endSnippet -->
358
358
359
359
@@ -384,7 +384,7 @@ public void NoUsing()
384
384
Debug.WriteLine(temp);
385
385
}
386
386
```
387
-
<sup><ahref='/src/Verify.Tests/TempFileTests.cs#L79-L92'title='Snippet source file'>snippet source</a> | <ahref='#snippet-TempFileNoUsing'title='Start of snippet'>anchor</a></sup>
387
+
<sup><ahref='/src/Verify.Tests/TempFileTests.cs#L128-L141'title='Snippet source file'>snippet source</a> | <ahref='#snippet-TempFileNoUsing'title='Start of snippet'>anchor</a></sup>
388
388
<!-- endSnippet -->
389
389
390
390
The file can then be manually inspected.
@@ -408,7 +408,7 @@ public void OpenExplorerAndDebug()
408
408
temp.OpenExplorerAndDebug();
409
409
}
410
410
```
411
-
<sup><ahref='/src/Verify.Tests/TempFileTests.cs#L64-L77'title='Snippet source file'>snippet source</a> | <ahref='#snippet-TempFileOpenExplorerAndDebug'title='Start of snippet'>anchor</a></sup>
411
+
<sup><ahref='/src/Verify.Tests/TempFileTests.cs#L113-L126'title='Snippet source file'>snippet source</a> | <ahref='#snippet-TempFileOpenExplorerAndDebug'title='Start of snippet'>anchor</a></sup>
412
412
<!-- endSnippet -->
413
413
414
414
This method is designed to help debug tests by enabling the inspection of the contents of the temporary file while the test is paused. It performs two actions:
0 commit comments