Skip to content

Commit 2c51080

Browse files
authored
Merge pull request #2655 from TheBlueMatt/2023-10-no-test-net
Replace `lightning-block-sync` test that depended on `foo.com`
2 parents ded9080 + 631f989 commit 2c51080

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lightning-block-sync/src/http.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -511,21 +511,19 @@ mod endpoint_tests {
511511

512512
#[test]
513513
fn convert_to_socket_addrs() {
514-
let endpoint = HttpEndpoint::for_host("foo.com".into());
514+
let endpoint = HttpEndpoint::for_host("localhost".into());
515515
let host = endpoint.host();
516516
let port = endpoint.port();
517517

518518
use std::net::ToSocketAddrs;
519519
match (&endpoint).to_socket_addrs() {
520520
Err(e) => panic!("Unexpected error: {:?}", e),
521-
Ok(mut socket_addrs) => {
522-
match socket_addrs.next() {
523-
None => panic!("Expected socket address"),
524-
Some(addr) => {
525-
assert_eq!(addr, (host, port).to_socket_addrs().unwrap().next().unwrap());
526-
assert!(socket_addrs.next().is_none());
527-
}
521+
Ok(socket_addrs) => {
522+
let mut std_addrs = (host, port).to_socket_addrs().unwrap();
523+
for addr in socket_addrs {
524+
assert_eq!(addr, std_addrs.next().unwrap());
528525
}
526+
assert!(std_addrs.next().is_none());
529527
}
530528
}
531529
}

0 commit comments

Comments
 (0)