Skip to content

Commit

Permalink
Add failing test to demonstrate bug in image-rs#41
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcde committed Apr 1, 2024
1 parent 3de009b commit bfed3a3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/end_of_buffer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use weezl::{decode, BitOrder};

#[test]
fn stop_after_end_of_buffer() {
let inp = vec![0x00u8, 0x01, 0x02, 0xff];
let mut decoder = decode::Decoder::new(BitOrder::Lsb, 7);
let mut out = vec![0u8, 0u8, 0u8];
let status = decoder.decode_bytes(&inp, &mut out).status;
assert!(status.is_ok(), "{:?} {:?}", status, out);
}

0 comments on commit bfed3a3

Please sign in to comment.