(t *testing.T)
| 290 | } |
| 291 | |
| 292 | func TestIsLocalHost(t *testing.T) { |
| 293 | for _, s := range []string{"localhost:10000", "[::1]:10000", "127.0.0.1:10000"} { |
| 294 | host, _, err := net.SplitHostPort(s) |
| 295 | if err != nil { |
| 296 | t.Error("unexpected error when splitting", s) |
| 297 | continue |
| 298 | } |
| 299 | if !isLocalhost(host) { |
| 300 | t.Errorf("host %s from %s not considered local", host, s) |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | func BenchmarkTop(b *testing.B) { benchmarkURL(b, "/top", false) } |
| 306 | func BenchmarkFlame(b *testing.B) { benchmarkURL(b, "/flamegraph", false) } |
nothing calls this directly
no test coverage detected
searching dependent graphs…