Skip to content

Commit

Permalink
Merge pull request #2655 from TheBlueMatt/2023-10-no-test-net
Browse files Browse the repository at this point in the history
Replace `lightning-block-sync` test that depended on `foo.com`
  • Loading branch information
TheBlueMatt authored Oct 14, 2023
2 parents ded9080 + 631f989 commit 2c51080
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lightning-block-sync/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,21 +511,19 @@ mod endpoint_tests {

#[test]
fn convert_to_socket_addrs() {
let endpoint = HttpEndpoint::for_host("foo.com".into());
let endpoint = HttpEndpoint::for_host("localhost".into());
let host = endpoint.host();
let port = endpoint.port();

use std::net::ToSocketAddrs;
match (&endpoint).to_socket_addrs() {
Err(e) => panic!("Unexpected error: {:?}", e),
Ok(mut socket_addrs) => {
match socket_addrs.next() {
None => panic!("Expected socket address"),
Some(addr) => {
assert_eq!(addr, (host, port).to_socket_addrs().unwrap().next().unwrap());
assert!(socket_addrs.next().is_none());
}
Ok(socket_addrs) => {
let mut std_addrs = (host, port).to_socket_addrs().unwrap();
for addr in socket_addrs {
assert_eq!(addr, std_addrs.next().unwrap());
}
assert!(std_addrs.next().is_none());
}
}
}
Expand Down

0 comments on commit 2c51080

Please sign in to comment.