fix windows build

This commit is contained in:
Adam Hathcock
2026-08-03 16:01:58 +01:00
parent d391cf21e1
commit 369ab91522

View File

@@ -40,13 +40,24 @@ public class LargeArchiveTests : TestBase
[InlineData("Large/Large.7z")]
public async Task OpenAsyncArchive_ShouldStreamLargeEntry(string fixtureName)
{
#if LEGACY_DOTNET
using var stream = new AsyncOnlyStream(
File.OpenRead(await GetMaterializedFixturePathAsync(fixtureName))
);
#else
await using var stream = new AsyncOnlyStream(
File.OpenRead(await GetMaterializedFixturePathAsync(fixtureName))
);
#endif
await using var archive = await ArchiveFactory.OpenAsyncArchive(stream);
var entry = await GetSingleEntryAsync(archive);
#if LEGACY_DOTNET
using var entryStream = await entry.OpenEntryStreamAsync();
#else
await using var entryStream = await entry.OpenEntryStreamAsync();
#endif
await VerifyContentAsync(entry.Key, entryStream);
}
@@ -72,14 +83,25 @@ public class LargeArchiveTests : TestBase
[InlineData("Large/Large.tar.gz")]
public async Task OpenAsyncReader_ShouldStreamLargeEntry(string fixtureName)
{
#if LEGACY_DOTNET
using var stream = new AsyncOnlyStream(
File.OpenRead(await GetMaterializedFixturePathAsync(fixtureName))
);
#else
await using var stream = new AsyncOnlyStream(
File.OpenRead(await GetMaterializedFixturePathAsync(fixtureName))
);
#endif
await using var reader = await ReaderFactory.OpenAsyncReader(stream);
Assert.True(await reader.MoveToNextEntryAsync());
Assert.False(reader.Entry.IsDirectory);
#if LEGACY_DOTNET
using var entryStream = await reader.OpenEntryStreamAsync();
#else
await using var entryStream = await reader.OpenEntryStreamAsync();
#endif
await VerifyContentAsync(reader.Entry.Key, entryStream);
Assert.False(await reader.MoveToNextEntryAsync());
}