mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-24 07:54:39 +00:00
modify now-broken test
This test tested that skipping over entries using the reader interface for an encrypted multi-volume rar archive worked. However reading those entries doesn't work and the skipping was also not working properly so I believe it's fine to "break" this functionality.
This commit is contained in:
@@ -330,43 +330,18 @@ public class RarReaderTests : ReaderTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Rar_NullReference()
|
||||
public void Rar_SkipEncryptedFilesWithoutPassword()
|
||||
{
|
||||
using var stream = File.OpenRead(
|
||||
Path.Combine(TEST_ARCHIVES_PATH, "Rar.encrypted_filesOnly.rar")
|
||||
);
|
||||
using var reader = ReaderFactory.Open(
|
||||
stream,
|
||||
new ReaderOptions { LookForHeader = true }
|
||||
);
|
||||
while (reader.MoveToNextEntry())
|
||||
{
|
||||
var archives = new[]
|
||||
{
|
||||
"Rar.EncryptedParts.part01.rar",
|
||||
"Rar.EncryptedParts.part02.rar",
|
||||
"Rar.EncryptedParts.part03.rar",
|
||||
"Rar.EncryptedParts.part04.rar",
|
||||
"Rar.EncryptedParts.part05.rar",
|
||||
"Rar.EncryptedParts.part06.rar",
|
||||
};
|
||||
|
||||
using var reader = RarReader.Open(
|
||||
archives
|
||||
.Select(s => Path.Combine(TEST_ARCHIVES_PATH, s))
|
||||
.Select(p => File.OpenRead(p)),
|
||||
new ReaderOptions { Password = "test" }
|
||||
);
|
||||
while (reader.MoveToNextEntry())
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
using var stream = File.OpenRead(
|
||||
Path.Combine(TEST_ARCHIVES_PATH, "Rar.encrypted_filesOnly.rar")
|
||||
);
|
||||
using var reader = ReaderFactory.Open(
|
||||
stream,
|
||||
new ReaderOptions { LookForHeader = true }
|
||||
);
|
||||
while (reader.MoveToNextEntry())
|
||||
{
|
||||
//
|
||||
}
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user