diff --git a/src/socket/udp.rs b/src/socket/udp.rs index 6f39aa4bc..269043ef7 100644 --- a/src/socket/udp.rs +++ b/src/socket/udp.rs @@ -743,6 +743,17 @@ mod test { assert_eq!(socket.send_slice(b"abcdef", REMOTE_END), Ok(())); } + #[test] + fn test_send_with_source() { + let mut socket = socket(buffer(0), buffer(1)); + + assert_eq!(socket.bind(LOCAL_PORT), Ok(())); + assert_eq!( + socket.send_slice(b"abcdef", remote_metadata_with_local()), + Ok(()) + ); + } + #[rstest] #[case::ip(Medium::Ip)] #[cfg(feature = "medium-ip")]