diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-06 15:35:24 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-06 15:35:24 +0200 |
| commit | 99b02bf8c389a793df5d5986db05eed7e459f7b1 (patch) | |
| tree | bc4e36cfcd3c9ef9b067beed2eb5b68a75a45aa2 /internal/flamegraph/webserver_autoreload_test.go | |
| parent | 4ff17c30120d657b966f8a55188ba167dc875e64 (diff) | |
refactor: remove web flamegrapher and keep TUI-only
Diffstat (limited to 'internal/flamegraph/webserver_autoreload_test.go')
| -rw-r--r-- | internal/flamegraph/webserver_autoreload_test.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/internal/flamegraph/webserver_autoreload_test.go b/internal/flamegraph/webserver_autoreload_test.go deleted file mode 100644 index ed4c907..0000000 --- a/internal/flamegraph/webserver_autoreload_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package flamegraph - -import ( - "net/http/httptest" - "strings" - "testing" - "time" -) - -func TestBuildSVGAutoReloadHandlerServesViewerPage(t *testing.T) { - mux := buildSVGAutoReloadHandler("/tmp/fake.svg", "/tmp/fake.svg", 2*time.Second) - - rec := httptest.NewRecorder() - req := httptest.NewRequest("GET", "http://localhost/", nil) - mux.ServeHTTP(rec, req) - - if rec.Code != 200 { - t.Fatalf("status code = %d, want 200", rec.Code) - } - if got := rec.Header().Get("Content-Type"); !strings.HasPrefix(got, "text/html") { - t.Fatalf("content type = %q, want text/html", got) - } - body := rec.Body.String() - if !strings.Contains(body, "Auto-refresh every 2000 ms.") { - t.Fatalf("viewer page missing refresh interval, body=%q", body) - } - if !strings.Contains(body, `id="fg"`) { - t.Fatalf("viewer page missing iframe, body=%q", body) - } -} - -func TestServeSVGAutoReloadRejectsNonPositiveInterval(t *testing.T) { - err := ServeSVGAutoReload("ignored.svg", 0) - if err == nil { - t.Fatal("expected error for non-positive interval") - } -} |
