From 2a3ba95630c52b6a94d67a5435af855462f2a47f Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 6 Aug 2024 08:47:26 +0200 Subject: [PATCH] test --- neqo-udp/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/neqo-udp/src/lib.rs b/neqo-udp/src/lib.rs index 688fb8ff65..0e0be1a760 100644 --- a/neqo-udp/src/lib.rs +++ b/neqo-udp/src/lib.rs @@ -136,6 +136,20 @@ mod tests { Ok(socket) } + #[test] + fn zero_sized_read() -> Result<(), io::Error> { + let socket = Socket::new(std::net::UdpSocket::bind("127.0.0.1:0")?)?; + let addr: SocketAddr = "127.0.0.1:0".parse().unwrap(); + socket + .recv(&addr) + .expect("receive to succeed") + .into_iter() + .next() + .expect("receive to yield datagram"); + + Ok(()) + } + #[test] fn datagram_tos() -> Result<(), io::Error> { let sender = socket()?;