diff --git a/tokio-udp/tests/udp.rs b/tokio-udp/tests/udp.rs
index f63fc9ad3..4f2915ea4 100644
--- a/tokio-udp/tests/udp.rs
+++ b/tokio-udp/tests/udp.rs
@@ -315,6 +315,74 @@ fn send_framed_lines_codec() {
assert_eq!(recv.next(), Some(("3".to_string(), a_addr)));
}
+#[test]
+fn recv_framed_codec_errs() {
+ drop(env_logger::try_init());
+
+ #[derive(Debug)]
+ struct LinesCodecMaxLen {
+ max_len: usize,
+ codec: LinesCodec,
+ }
+
+ impl LinesCodecMaxLen {
+ fn new(max_len: usize) -> Self {
+ Self {
+ max_len,
+ codec: LinesCodec::new(),
+ }
+ }
+ }
+
+ impl Decoder for LinesCodecMaxLen {
+ type Item = String;
+ type Error = io::Error;
+
+ fn decode(&mut self, buf: &mut BytesMut) -> Result