Skip to content

Commit

Permalink
test(common): add basic test for AlertOnEos
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkarw committed Aug 19, 2022
1 parent 34ed89d commit c004653
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/common/buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,15 @@ impl<B: Buf> Buf for AlertOnEos<B> {

#[cfg(test)]
mod tests {
use crate::common::buf::AlertOnEos;
use hyper::body::Bytes;
use std::time::Duration;

}
#[tokio::test]
async fn test_get_notified() {
let buf = Bytes::from_static(b"");
let (_buf, signaler) = AlertOnEos::new(buf);
let result = tokio::time::timeout(Duration::from_secs(1), signaler.wait_till_eos()).await;
assert_eq!(result, Ok(()));
}
}

0 comments on commit c004653

Please sign in to comment.