Skip to content

Commit

Permalink
net/url: add tests for URLHostname
Browse files Browse the repository at this point in the history
  • Loading branch information
desimone committed May 6, 2019
1 parent f4a5ae5 commit 18f2d59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/net/url/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,12 @@ func TestURLHostname(t *testing.T) {
{"[1:2:3:4]", "1:2:3:4"},
{"[1:2:3:4]:80", "1:2:3:4"},
{"[::1]:80", "::1"},
{"[::1]", "::1"},
{"localhost", "localhost"},
{"localhost:443", "localhost"},
{"some.super.long.domain.example.org:8080", "some.super.long.domain.example.org"},
{"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:17000", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"},
{"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"},
}
for _, tt := range tests {
u := &URL{Host: tt.host}
Expand Down

0 comments on commit 18f2d59

Please sign in to comment.