Fix the non-readble IpAddr serialize implementations

This commit is contained in:
Markus Westerlind committed 2017-09-11 17:40:02 +02:00
1 parent c2474bf6ee
commit 85c05d301a
2 files changed
+27 -5

No files matched your search

+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 },