tests: adapt tests to decoder interface changes

The `Decoder`s `contents` method call can fail because of an added
consistency check when using split variant inputs.

Therefore, the additional error has to be handled by the callers.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2024-06-12 15:17:11 +02:00 committed by Fabian Grünbichler
parent 10645277ed
commit d0dda0eda4
2 changed files with 2 additions and 1 deletions

View File

@ -125,6 +125,7 @@ fn test_archive() {
let mut content = Vec::new(); let mut content = Vec::new();
decoder decoder
.contents() .contents()
.expect("failed to get contents from decoder")
.expect("failed to get contents for file entry") .expect("failed to get contents for file entry")
.read_to_end(&mut content) .read_to_end(&mut content)
.expect("failed to read test file contents"); .expect("failed to read test file contents");

View File

@ -235,7 +235,7 @@ impl Entry {
PxarEntryKind::File { size, .. } => { PxarEntryKind::File { size, .. } => {
let mut data = Vec::new(); let mut data = Vec::new();
decoder decoder
.contents() .contents()?
.ok_or_else(|| { .ok_or_else(|| {
format_err!("failed to get contents for file entry: {:?}", item.path()) format_err!("failed to get contents for file entry: {:?}", item.path())
})? })?