(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func 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 | |
| 38 | func TestSnapshotHandler_Err(t *testing.T) { |
| 39 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…