Skip to content

Commit 9be5ad6

Browse files
committed
test DialArgs changes
1 parent 50cc0e4 commit 9be5ad6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

convert_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,10 @@ func TestDialArgs(t *testing.T) {
141141
test("/ip4/127.0.0.1/tcp/4321", "tcp4", "127.0.0.1:4321")
142142
test("/ip6/::1/udp/1234", "udp6", "[::1]:1234")
143143
test("/ip6/::1/tcp/4321", "tcp6", "[::1]:4321")
144+
test("/ip6/::1", "ip6", "::1") // Just an IP
145+
test("/ip4/1.2.3.4", "ip4", "1.2.3.4") // Just an IP
146+
test("/ip6zone/foo/ip6/::1/tcp/4321", "tcp6", "[::1%foo]:4321") // zone
147+
test("/ip6zone/foo/ip6/::1", "ip6", "::1%foo") // no TCP
148+
test("/ip6zone/foo/ip6/::1/ip6zone/bar", "ip6", "::1%foo") // IP over IP
149+
test("/ip6zone/foo/ip4/127.0.0.1/ip6zone/bar", "ip4", "127.0.0.1") // Skip zones in IP
144150
}

0 commit comments

Comments
 (0)