Skip to content

Commit 3824219

Browse files
committed
tests: Add a test that explicitly sets the local address
1 parent 3157e6e commit 3824219

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/socket/udp.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,17 @@ mod test {
743743
assert_eq!(socket.send_slice(b"abcdef", REMOTE_END), Ok(()));
744744
}
745745

746+
#[test]
747+
fn test_send_with_source() {
748+
let mut socket = socket(buffer(0), buffer(1));
749+
750+
assert_eq!(socket.bind(LOCAL_PORT), Ok(()));
751+
assert_eq!(
752+
socket.send_slice(b"abcdef", remote_metadata_with_local()),
753+
Ok(())
754+
);
755+
}
756+
746757
#[rstest]
747758
#[case::ip(Medium::Ip)]
748759
#[cfg(feature = "medium-ip")]

0 commit comments

Comments
 (0)