Skip to content

Commit

Permalink
tests: Add a test that explicitly sets the local address
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Feb 2, 2024
1 parent 3157e6e commit 3824219
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/socket/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 3824219

Please sign in to comment.