diff --git a/src/common/buf.rs b/src/common/buf.rs index 3b42682..455085b 100644 --- a/src/common/buf.rs +++ b/src/common/buf.rs @@ -61,5 +61,16 @@ impl Buf for AlertOnEos { #[cfg(test)] mod tests { + use crate::common::buf::AlertOnEos; + use hyper::body::{Buf, Bytes}; + use std::time::Duration; -} \ No newline at end of file + #[tokio::test] + async fn test_get_notified() { + let buf = Bytes::from_static(b"abc"); + let (mut buf, signaler) = AlertOnEos::new(buf); + buf.advance(3); + let result = tokio::time::timeout(Duration::from_secs(1), signaler.wait_till_eos()).await; + assert_eq!(result, Ok(())); + } +}