MCPcopy
hub / github.com/OJ/gobuster / httpServer

Function httpServer

cli/dir/dir_test.go:17–25  ·  view source on GitHub ↗
(b *testing.B, content string)

Source from the content-addressed store, hash-verified

15)
16
17func 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
27func BenchmarkDirMode(b *testing.B) {
28 h := httpServer(b, "test")

Callers 1

BenchmarkDirModeFunction · 0.70

Calls 1

FatalfMethod · 0.80

Tested by

no test coverage detected