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:
Dylan M. Taylor committed 2026-11-18 07:44:01 -05:00
1 parent d9ebc75707
commit 47384980a4
1 file changed
+7
+7
View File
@@ -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(_))));
}