Skip to content

Commit

Permalink
Fix Ipv6Addr: Display tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clarfonthey committed Jun 14, 2023
1 parent 3a9a8d4 commit 2f2c3f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/tests/net/ip_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fn ipv6_addr_to_string() {

// ipv4-compatible address
let a1 = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0xc000, 0x280);
assert_eq!(a1.to_string(), "::192.0.2.128");
assert_eq!(a1.to_string(), "::c000:280");

// v6 address with no zero segments
assert_eq!(Ipv6Addr::new(8, 9, 10, 11, 12, 13, 14, 15).to_string(), "8:9:a:b:c:d:e:f");
Expand Down Expand Up @@ -316,7 +316,7 @@ fn ip_properties() {

check!("::", unspec);
check!("::1", loopback);
check!("::0.0.0.2", global);
check!("::2", global);
check!("1::", global);
check!("fc00::");
check!("fdff:ffff::");
Expand Down Expand Up @@ -607,7 +607,7 @@ fn ipv6_properties() {

check!("::1", &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], loopback);

check!("::0.0.0.2", &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], global | unicast_global);
check!("::2", &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], global | unicast_global);

check!("1::", &[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], global | unicast_global);

Expand Down

0 comments on commit 2f2c3f5

Please sign in to comment.