add a small test case for Err result

This commit is contained in:
Guanqun Lu
2017-11-16 23:59:38 +08:00
parent a62f9f801d
commit 15df93a954
2 changed files with 3 additions and 1 deletions

View File

@ -108,6 +108,8 @@ mod tests {
fn multiaddr_to_tcp_conversion() {
use std::net::Ipv6Addr;
assert!(multiaddr_to_socketaddr(&Multiaddr::new("/ip4/127.0.0.1/udp/1234").unwrap()).is_err());
assert_eq!(
multiaddr_to_socketaddr(&Multiaddr::new("/ip4/127.0.0.1/tcp/12345").unwrap()),
Ok(SocketAddr::new(

View File

@ -23,7 +23,7 @@
use protocol::MultistreamSelectError;
use std::io::Error as IoError;
/// Error that can happen when negociating a protocol with the remote.
/// Error that can happen when negotiating a protocol with the remote.
#[derive(Debug)]
pub enum ProtocolChoiceError {
/// Error in the protocol.