Skip to content

Commit a599e92

Browse files
committed
Add more assertions: Assert that read happened as expected
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
1 parent 88c80cc commit a599e92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/reader.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ mod tests {
390390
fn test_try_read() {
391391
let f = io::Cursor::new("lorem");
392392
let mut r = NBReader::new(f, None);
393-
r.read_until(&ReadUntil::NBytes(4)).expect("4 bytes");
393+
let bytes = r.read_until(&ReadUntil::NBytes(4)).unwrap();
394+
assert!(bytes.0.is_empty());
395+
assert_eq!(bytes.1, "lore");
394396
assert_eq!(Some('m'), r.try_read());
395397
assert_eq!(None, r.try_read());
396398
assert_eq!(None, r.try_read());

0 commit comments

Comments
 (0)