mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-13 21:22:22 +00:00
# Conflicts: # src/SharpCompress/Archives/GZip/GZipArchive.cs # src/SharpCompress/Common/GZip/GZipFilePart.cs # src/SharpCompress/Common/Tar/Headers/TarHeader.cs # src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs # src/SharpCompress/Common/Zip/ZipFilePart.cs # src/SharpCompress/Compressors/Deflate/ZlibBaseStream.cs # src/SharpCompress/Compressors/LZMA/LZipStream.cs # src/SharpCompress/Compressors/Xz/BinaryUtils.cs # src/SharpCompress/Compressors/Xz/Crc32.cs # src/SharpCompress/Writers/Tar/TarWriter.cs # src/SharpCompress/Writers/Zip/ZipCentralDirectoryEntry.cs # src/SharpCompress/Writers/Zip/ZipWriter.cs
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using System.IO;
|
|
using System.Threading.Tasks;
|
|
using SharpCompress.Common;
|
|
using SharpCompress.IO;
|
|
using Xunit;
|
|
|
|
namespace SharpCompress.Test.GZip
|
|
{
|
|
public class GZipReaderTests : ReaderTests
|
|
{
|
|
public GZipReaderTests()
|
|
{
|
|
UseExtensionInsteadOfNameToVerify = true;
|
|
}
|
|
|
|
[Fact]
|
|
public async ValueTask GZip_Reader_Generic()
|
|
{
|
|
await ReadAsync("Tar.tar.gz", CompressionType.GZip);
|
|
}
|
|
|
|
|
|
[Fact]
|
|
public async ValueTask GZip_Reader_Generic2()
|
|
{
|
|
//read only as GZip itme
|
|
await using (Stream stream = File.OpenRead(Path.Combine(TEST_ARCHIVES_PATH, "Tar.tar.gz")))
|
|
await using (var reader = SharpCompress.Readers.GZip.GZipReader.Open(new RewindableStream(stream)))
|
|
{
|
|
while (await reader.MoveToNextEntryAsync()) // Crash here
|
|
{
|
|
Assert.NotEqual(0, reader.Entry.Size);
|
|
Assert.NotEqual(0, reader.Entry.Crc);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|