(b *testing.B)
| 120 | } |
| 121 | |
| 122 | func Benchmark_normalizeSchemeHost(b *testing.B) { |
| 123 | cases := []struct{ name, scheme, host string }{ |
| 124 | {"noport", "https", "example.com"}, |
| 125 | {"port", "https", "example.com:8080"}, |
| 126 | {"ipv4", "https", "192.168.0.1"}, |
| 127 | } |
| 128 | for _, tc := range cases { |
| 129 | b.Run(tc.name, func(b *testing.B) { |
| 130 | b.ReportAllocs() |
| 131 | var s string |
| 132 | for b.Loop() { |
| 133 | s = normalizeSchemeHost(tc.scheme, tc.host) |
| 134 | } |
| 135 | _ = s |
| 136 | }) |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | func Benchmark_Match(b *testing.B) { |
| 141 | b.ReportAllocs() |
nothing calls this directly
no test coverage detected