MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_parse_proxy_addr

Function test_parse_proxy_addr

plugins/currencyrate-plugin/src/main.rs:349–365  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

347
348#[test]
349fn test_parse_proxy_addr() {
350 assert_eq!(
351 parse_proxy_addr("127.0.0.1:9050").unwrap(),
352 "127.0.0.1:9050".parse().unwrap()
353 );
354 assert_eq!(
355 parse_proxy_addr("127.0.0.1").unwrap(),
356 "127.0.0.1:9050".parse().unwrap()
357 );
358
359 for proxy in ["::1", "[::1]:9050"] {
360 let err = parse_proxy_addr(proxy).unwrap_err().to_string();
361 assert!(err.contains("IPv6 proxy addresses are not supported"));
362 }
363
364 assert!(parse_proxy_addr("not-an-address").is_err());
365}
366
367fn gather_sources(
368 plugin: &ConfiguredPlugin<PluginState, tokio::io::Stdin, tokio::io::Stdout>,

Callers

nothing calls this directly

Calls 3

parse_proxy_addrFunction · 0.85
unwrap_errMethod · 0.80
to_stringMethod · 0.45

Tested by

no test coverage detected