MCPcopy Index your code
hub / github.com/maruel/panicparse / TestSnapshotHandler

Function TestSnapshotHandler

stack/webstack/webstack_test.go:14–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestSnapshotHandler(t *testing.T) {
15 data := []string{
16 "/debug",
17 "/debug?augment=1",
18 "/debug?maxmem=1",
19 "/debug?maxmem=2097152",
20 "/debug?similarity=exactflags",
21 "/debug?similarity=exactlines",
22 "/debug?similarity=anypointer",
23 "/debug?similarity=anyvalue",
24 }
25 for _, url := range data {
26 url := url
27 t.Run(url, func(t *testing.T) {
28 req := httptest.NewRequest("GET", url, nil)
29 w := httptest.NewRecorder()
30 SnapshotHandler(w, req)
31 if w.Code != 200 {
32 t.Fatalf("%s: %d\n%s", url, w.Code, w.Body.String())
33 }
34 })
35 }
36}
37
38func TestSnapshotHandler_Err(t *testing.T) {
39 t.Parallel()

Callers

nothing calls this directly

Calls 2

SnapshotHandlerFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…