Fix the non-readble IpAddr serialize implementations

This commit is contained in:
Markus Westerlind
2017-09-11 17:39:57 +02:00
parent c2474bf6ee
commit 85c05d301a
2 changed files with 27 additions and 5 deletions
+11
View File
@@ -426,8 +426,19 @@ declare_non_human_readable_tests!{
Token::TupleEnd,
],
}
test_non_human_readable_net_ipaddr {
net::IpAddr::from(*b"1234") => &seq![
Token::NewtypeVariant { name: "IpAddr", variant: "V4" },
Token::Tuple { len: 4 },
seq b"1234".iter().map(|&b| Token::U8(b)),
Token::TupleEnd,
],
}
test_non_human_readable_net_socketaddr {
net::SocketAddr::from((*b"1234567890123456", 1234)) => &seq![
Token::NewtypeVariant { name: "SocketAddr", variant: "V6" },
Token::Tuple { len: 2 },
Token::Tuple { len: 16 },