Skip to content

Commit 90be9ca

Browse files
committed
tests: Add a test that explicitly sets the local address
1 parent c27e45d commit 90be9ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/socket/udp.rs

+8
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,14 @@ 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!(socket.send_slice(b"abcdef", remote_metadata_with_local()), Ok(()));
752+
}
753+
746754
#[rstest]
747755
#[case::ip(Medium::Ip)]
748756
#[cfg(feature = "medium-ip")]

0 commit comments

Comments
 (0)