(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func Test_normalizeSchemeHost(t *testing.T) { |
| 80 | t.Parallel() |
| 81 | testCases := []struct { |
| 82 | name, scheme, host, expectedHost string |
| 83 | }{ |
| 84 | {"http default port added", "http", "example.com", "example.com:80"}, |
| 85 | {"https default port added", "https", "example.com", "example.com:443"}, |
| 86 | {"http custom port preserved", "http", "example.com:8080", "example.com:8080"}, |
| 87 | {"https ipv6 default port added", "https", "[::1]", "[::1]:443"}, |
| 88 | {"unknown scheme preserved", "ftp", "example.com", "example.com"}, |
| 89 | {"https ipv6 custom port preserved", "https", "[::1]:8080", "[::1]:8080"}, |
| 90 | } |
| 91 | for _, tc := range testCases { |
| 92 | t.Run(tc.name, func(t *testing.T) { |
| 93 | t.Parallel() |
| 94 | assert.Equal(t, tc.expectedHost, normalizeSchemeHost(tc.scheme, tc.host)) |
| 95 | }) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | func Test_Match(t *testing.T) { |
| 100 | t.Parallel() |
nothing calls this directly
no test coverage detected