mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-19 16:45:28 +00:00
psd: cover the shared PackBits row-limit error mapping
The recovery wrapper maps every non-decompress failure to Error::Invalid so a limit refusal is never reported as truncated data. That arm had no test, which left the changed lines under the coverage gate.
This commit is contained in:
1 file changed
+7
@@ -609,3 +609,10 @@ fn shared_packbits_keeps_padded_rows_and_truncated_packet_errors() {
|
||||
unpack_bits(&[0, 9, 255], 1, &mut row).unwrap();
|
||||
assert_eq!(row, [9]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shared_packbits_reports_row_limits_as_invalid_not_truncated() {
|
||||
// The shared recovery decoder refuses a row beyond its decoded-size limit. That refusal
|
||||
// is a limit, not truncated PackBits data, so the wrapper must not report it as one.
|
||||
assert!(matches!(unpack_bits(&[], usize::MAX, &mut Vec::new()), Err(Error::Invalid(_))));
|
||||
}
|
||||
Reference in new issue
Block a user