(b *testing.B, content string)
| 15 | ) |
| 16 | |
| 17 | func httpServer(b *testing.B, content string) *httptest.Server { |
| 18 | b.Helper() |
| 19 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { |
| 20 | if _, err := fmt.Fprint(w, content); err != nil { |
| 21 | b.Fatalf("%v", err) |
| 22 | } |
| 23 | })) |
| 24 | return ts |
| 25 | } |
| 26 | |
| 27 | func BenchmarkDirMode(b *testing.B) { |
| 28 | h := httpServer(b, "test") |
no test coverage detected