2025-11-26 08:09:20 +00:00
|
|
|
using System;
|
2025-03-09 18:22:52 +01:00
|
|
|
using SharpCompress.Common;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
namespace SharpCompress.Test.Arc;
|
|
|
|
|
|
|
|
|
|
public class ArcReaderTests : ReaderTests
|
2025-03-09 18:22:52 +01:00
|
|
|
{
|
2026-02-04 09:25:48 +00:00
|
|
|
public ArcReaderTests()
|
2025-03-09 18:22:52 +01:00
|
|
|
{
|
2026-02-04 09:25:48 +00:00
|
|
|
UseExtensionInsteadOfNameToVerify = true;
|
|
|
|
|
UseCaseInsensitiveToVerify = true;
|
|
|
|
|
}
|
2025-03-09 18:22:52 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Fact]
|
|
|
|
|
public void Arc_Uncompressed_Read() => Read("Arc.uncompressed.arc", CompressionType.None);
|
2025-03-11 18:15:53 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Fact]
|
|
|
|
|
public void Arc_Squeezed_Read() => Read("Arc.squeezed.arc");
|
2025-03-14 19:06:14 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Fact]
|
|
|
|
|
public void Arc_Crunched_Read() => Read("Arc.crunched.arc");
|
2025-11-20 19:43:07 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Theory]
|
|
|
|
|
[InlineData("Arc.crunched.largefile.arc", CompressionType.Crunched)]
|
|
|
|
|
public void Arc_LargeFile_ShouldThrow(string fileName, CompressionType compressionType)
|
|
|
|
|
{
|
|
|
|
|
var exception = Assert.Throws<NotSupportedException>(() =>
|
|
|
|
|
ReadForBufferBoundaryCheck(fileName, compressionType)
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-11-22 12:32:25 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Theory]
|
|
|
|
|
[InlineData("Arc.uncompressed.largefile.arc", CompressionType.None)]
|
|
|
|
|
[InlineData("Arc.squeezed.largefile.arc", CompressionType.Squeezed)]
|
|
|
|
|
public void Arc_LargeFileTest_Read(string fileName, CompressionType compressionType)
|
|
|
|
|
{
|
|
|
|
|
ReadForBufferBoundaryCheck(fileName, compressionType);
|
2025-03-09 18:22:52 +01:00
|
|
|
}
|
|
|
|
|
}
|