mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-23 15:34:34 +00:00
Dispose caller-provided stream in async archive open test
This commit is contained in:
committed by
GitHub
parent
851aa391c6
commit
0a3c36dc80
@@ -125,15 +125,22 @@ public class AsyncParityAndCancellationTests : TestBase
|
||||
);
|
||||
var stream = new TestStream(new MemoryStream(archiveBytes));
|
||||
|
||||
await using (var archive = await ArchiveFactory.OpenAsyncArchive(stream))
|
||||
try
|
||||
{
|
||||
await foreach (var _ in archive.EntriesAsync)
|
||||
await using (var archive = await ArchiveFactory.OpenAsyncArchive(stream))
|
||||
{
|
||||
break;
|
||||
await foreach (var _ in archive.EntriesAsync)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Assert.False(stream.IsDisposed);
|
||||
Assert.False(stream.IsDisposed);
|
||||
}
|
||||
finally
|
||||
{
|
||||
await stream.DisposeAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private static List<EntrySnapshot> ReadArchiveEntries(string archivePath)
|
||||
|
||||
Reference in New Issue
Block a user