Skip to content

Commit

Permalink
test(objectarium): add lzma decompression
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikssonJoakim committed Jul 31, 2023
1 parent 8eff8a8 commit 79fcb4c
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions contracts/okp4-objectarium/src/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,30 @@ mod tests {

#[test]
fn test_from_io_decompress_error() {
let cases = vec![(
std::io::Error::new(
std::io::ErrorKind::InvalidData,
"the expected decompressed size differs, actual 998, expected 1000",
let cases = vec![
(
std::io::Error::new(
std::io::ErrorKind::InvalidData,
"the expected decompressed size differs, actual 998, expected 1000",
),
CompressionError::Error(
"the expected decompressed size differs, actual 998, expected 1000".to_string(),
),
),
CompressionError::Error(
"the expected decompressed size differs, actual 998, expected 1000".to_string(),
(
std::io::Error::new(
std::io::ErrorKind::InvalidData,
lzma_rs::error::Error::IoError(std::io::Error::new(
std::io::ErrorKind::InvalidData,
"the expected decompressed size differs, actual 998, expected 1000",
)),
),
CompressionError::Error(
"io error: the expected decompressed size differs, actual 998, expected 1000"
.to_string(),
),
),
)];
];

for (error, expected_error) in cases {
let compression_err = CompressionError::from(error);
Expand Down

0 comments on commit 79fcb4c

Please sign in to comment.