unittest for bind two consecutive ports (#23008)

* minor fix of comments in fork-selection tests

* fix doc link

* add unittest for bind_two_consecutive_in_range
This commit is contained in:
HaoranYi
2022-03-02 09:10:29 -06:00
committed by GitHub
parent 8de88d0a55
commit 4f0070a5c6
2 changed files with 13 additions and 3 deletions

View File

@ -790,4 +790,14 @@ mod tests {
3,
));
}
#[test]
fn test_bind_two_consecutive_in_range() {
solana_logger::setup();
let ip_addr = IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0));
if let Ok(((port1, _), (port2, _))) = bind_two_consecutive_in_range(ip_addr, (1024, 65535))
{
assert!(port2 == port1 + 1);
}
}
}