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 c27e45d commit 90be9ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/socket/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,14 @@ 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 90be9ca

Please sign in to comment.