Repository navigation
Description
See parent issue #127376.
Ideally, introduce similar abstraction like used in ZipArchive tests, so that tests can be parameterized by a bool to test both sync and async code paths.
runtime/src/libraries/Common/tests/System/IO/Compression/ZipTestHelper.cs
Lines 541 to 564 in 6f2ad2d
| public static async Task<ZipArchive> CreateZipArchive(bool async, Stream stream, ZipArchiveMode mode, bool leaveOpen = false, Encoding entryNameEncoding = null) | |
| { | |
| return async ? | |
| await ZipArchive.CreateAsync(stream, mode, leaveOpen, entryNameEncoding) : | |
| new ZipArchive(stream, mode, leaveOpen, entryNameEncoding); | |
| } | |
| public static async Task DisposeZipArchive(bool async, ZipArchive archive) | |
| { | |
| if (async) | |
| { | |
| await archive.DisposeAsync(); | |
| } | |
| else | |
| { | |
| archive.Dispose(); | |
| } | |
| } | |
| public static async Task<Stream> OpenEntryStream(bool async, ZipArchiveEntry entry) | |
| { | |
| return async ? await entry.OpenAsync() : entry.Open(); | |
| } | |
Activity
dotnet-policy-service commentedon Apr 24, 2026
Tagging subscribers to this area: @dotnet/area-system-formats-tar
See info in area-owners.md if you want to be subscribed.
Tar tests deduplicate (dotnet#130407)