fix some 7z tests
This commit is contained in:
parent
85d82e5c86
commit
db0bb8a30d
2 changed files with 23 additions and 25 deletions
|
|
@ -91,7 +91,7 @@ public class ArchiveTests : ReaderTests
|
|||
testArchive = Path.Combine(TEST_ARCHIVES_PATH, testArchive);
|
||||
ArchiveStreamRead(
|
||||
ArchiveFactory.FindFactory<IArchiveFactory>(testArchive),
|
||||
Path.GetExtension(testArchive).Substring(1),
|
||||
Path.GetExtension(testArchive),
|
||||
readerOptions,
|
||||
testArchive
|
||||
);
|
||||
|
|
@ -139,8 +139,7 @@ public class ArchiveTests : ReaderTests
|
|||
string extension
|
||||
)
|
||||
{
|
||||
extension.Should().BeOneOf(archiveFactory.GetSupportedExtensions());
|
||||
|
||||
ExtensionTest(extension, archiveFactory);
|
||||
foreach (var path in testArchives)
|
||||
{
|
||||
using (
|
||||
|
|
@ -299,11 +298,7 @@ public class ArchiveTests : ReaderTests
|
|||
{
|
||||
testArchive = Path.Combine(TEST_ARCHIVES_PATH, testArchive);
|
||||
archiveFactory ??= ArchiveFactory.FindFactory<IArchiveFactory>(testArchive);
|
||||
string extension = Path.GetExtension(testArchive).Substring(1);
|
||||
if (!int.TryParse(extension, out _) && "exe" != extension) //exclude parts
|
||||
{
|
||||
extension.Should().BeOneOf(archiveFactory.GetSupportedExtensions());
|
||||
}
|
||||
ExtensionTest(testArchive, archiveFactory);
|
||||
using (var archive = archiveFactory.OpenArchive(new FileInfo(testArchive), readerOptions))
|
||||
{
|
||||
foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))
|
||||
|
|
@ -317,6 +312,15 @@ public class ArchiveTests : ReaderTests
|
|||
VerifyFiles();
|
||||
}
|
||||
|
||||
private void ExtensionTest(string fullPath, IArchiveFactory archiveFactory)
|
||||
{
|
||||
var extension = Path.GetExtension(fullPath).Substring(1);
|
||||
if (!int.TryParse(extension, out _) && "exe" != extension) //exclude parts
|
||||
{
|
||||
extension.Should().BeOneOf(archiveFactory.GetSupportedExtensions());
|
||||
}
|
||||
}
|
||||
|
||||
protected void ArchiveFileSkip(
|
||||
string testArchive,
|
||||
string fileOrder,
|
||||
|
|
|
|||
|
|
@ -83,10 +83,8 @@ public class SevenZipArchiveTests : ArchiveTests
|
|||
|
||||
[Fact]
|
||||
public void SevenZipArchive_BZip2_Split() =>
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
ArchiveStreamRead(
|
||||
".7z",
|
||||
null,
|
||||
ArchiveStreamMultiRead(
|
||||
null,
|
||||
"Original.7z.001",
|
||||
"Original.7z.002",
|
||||
"Original.7z.003",
|
||||
|
|
@ -94,8 +92,7 @@ public class SevenZipArchiveTests : ArchiveTests
|
|||
"Original.7z.005",
|
||||
"Original.7z.006",
|
||||
"Original.7z.007"
|
||||
)
|
||||
);
|
||||
);
|
||||
|
||||
//Same as archive as Original.7z.001 ... 007 files without the root directory 'Original\' in the archive - this caused the verify to fail
|
||||
[Fact]
|
||||
|
|
@ -150,17 +147,14 @@ public class SevenZipArchiveTests : ArchiveTests
|
|||
|
||||
[Fact]
|
||||
public void SevenZipArchive_ZSTD_Split() =>
|
||||
Assert.Throws<InvalidOperationException>(() =>
|
||||
ArchiveStreamRead(
|
||||
".7z",
|
||||
null,
|
||||
"7Zip.ZSTD.Split.7z.001",
|
||||
"7Zip.ZSTD.Split.7z.002",
|
||||
"7Zip.ZSTD.Split.7z.003",
|
||||
"7Zip.ZSTD.Split.7z.004",
|
||||
"7Zip.ZSTD.Split.7z.005",
|
||||
"7Zip.ZSTD.Split.7z.006"
|
||||
)
|
||||
ArchiveStreamMultiRead(
|
||||
null,
|
||||
"7Zip.ZSTD.Split.7z.001",
|
||||
"7Zip.ZSTD.Split.7z.002",
|
||||
"7Zip.ZSTD.Split.7z.003",
|
||||
"7Zip.ZSTD.Split.7z.004",
|
||||
"7Zip.ZSTD.Split.7z.005",
|
||||
"7Zip.ZSTD.Split.7z.006"
|
||||
);
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue