This commit is contained in:
Adam Hathcock
2026-05-29 09:25:52 +01:00
parent ae8d983b72
commit d6efe32cda
2 changed files with 11 additions and 3 deletions

View File

@@ -39,7 +39,11 @@ public static class IAsyncArchiveExtensions
cancellationToken.ThrowIfCancellationRequested();
await reader
.WriteEntryToDirectoryAsync(destinationDirectory, options, cancellationToken)
.WriteEntryToDirectoryAsync(
destinationDirectory,
options,
cancellationToken
)
.ConfigureAwait(false);
if (reader.Entry.IsDirectory)

View File

@@ -147,14 +147,18 @@ public class SevenZipArchiveAsyncTests : ArchiveTests
public async Task SevenZipArchive_Solid_WriteToDirectoryAsync_WithProgress()
{
var progressReports = new System.Collections.Generic.List<ProgressReport>();
var progress = new SynchronousProgress<ProgressReport>(report => progressReports.Add(report));
var progress = new SynchronousProgress<ProgressReport>(report =>
progressReports.Add(report)
);
var testArchive = Path.Combine(TEST_ARCHIVES_PATH, "7Zip.solid.7z");
#if NETFRAMEWORK
using var stream = File.OpenRead(testArchive);
#else
await using var stream = File.OpenRead(testArchive);
#endif
await using var archive = await ArchiveFactory.OpenAsyncArchive(new AsyncOnlyStream(stream));
await using var archive = await ArchiveFactory.OpenAsyncArchive(
new AsyncOnlyStream(stream)
);
await archive.WriteToDirectoryAsync(SCRATCH_FILES_PATH, progress: progress);