MCPcopy Index your code
hub / github.com/DoNewsCode/core / TestDebugModule

Function TestDebugModule

srvhttp/debug_test.go:12–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestDebugModule(t *testing.T) {
13 router := mux.NewRouter()
14 DebugModule{}.ProvideHTTP(router)
15
16 paths := []string{
17 "/debug/pprof/cmdline",
18 "/debug/pprof/profile?seconds=1",
19 "/debug/pprof/symbol",
20 "/debug/pprof/trace",
21 "/debug/pprof/heap",
22 "/debug/pprof/allocs",
23 "/debug/pprof/block",
24 "/debug/pprof/goroutine",
25 "/debug/pprof/mutex",
26 "/debug/pprof/threadcreate",
27 }
28 for _, path := range paths {
29 t.Run(path, func(t *testing.T) {
30 req := httptest.NewRequest("GET", path, nil)
31 rr := httptest.NewRecorder()
32 router.ServeHTTP(rr, req)
33 assert.Equal(t, http.StatusOK, rr.Code)
34 })
35 }
36}

Callers

nothing calls this directly

Calls 3

ProvideHTTPMethod · 0.65
RunMethod · 0.45
ServeHTTPMethod · 0.45

Tested by

no test coverage detected