Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrumley committed Aug 26, 2023
1 parent 7dd61a9 commit 6165a4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rust/sbp/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ mod tests {
let timeout_duration = Duration::from_secs(2);
let now = Instant::now();
let mut messages = iter_messages_with_timeout(rdr, timeout_duration);
assert_eq!(messages.next().unwrap(), Err(Error::IoError(_)));
assert!(matches!(
messages.next().unwrap().unwrap_err(),
Error::IoError(_)
));
assert!(now.elapsed() >= timeout_duration);
}

Expand Down Expand Up @@ -494,7 +497,7 @@ mod tests {
let data = vec![0u8; 1000];
let mut bytes = BytesMut::from(&data[..]);
assert_eq!(bytes.len(), 1000);
assert_eq!(FramerImpl.decode(&mut bytes).unwrap(), None);
assert!(FramerImpl.decode(&mut bytes).unwrap().is_none());
}

#[test]
Expand Down

0 comments on commit 6165a4d

Please sign in to comment.