Skip to content

Commit 216366f

Browse files
test: add regression test for #730
1 parent 96d78bd commit 216366f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_buf.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ fn test_get_u16() {
3636
assert_eq!(0x5421, buf.get_u16_le());
3737
}
3838

39+
#[test]
40+
fn test_get_int() {
41+
let mut buf = &b"\xfe\x1d\xc0zomg"[..];
42+
assert_eq!(0xffffffffffc01dfeu64 as i64, buf.get_int_le(3));
43+
let mut buf = &b"\xfe\x1d\xc0zomg"[..];
44+
assert_eq!(0xfffffffffffe1dc0u64 as i64, buf.get_int(3));
45+
}
46+
3947
#[test]
4048
#[should_panic]
4149
fn test_get_u16_buffer_underflow() {

0 commit comments

Comments
 (0)