MCPcopy Create free account
hub / github.com/google/pprof / compareGraphs

Function compareGraphs

internal/graph/dotgraph_test.go:215–235  ·  view source on GitHub ↗
(t *testing.T, got []byte, wantFile string)

Source from the content-addressed store, hash-verified

213}
214
215func compareGraphs(t *testing.T, got []byte, wantFile string) {
216 wantFile = filepath.Join("testdata", wantFile)
217 want, err := os.ReadFile(wantFile)
218 if err != nil {
219 t.Fatalf("error reading test file %s: %v", wantFile, err)
220 }
221
222 if string(got) != string(want) {
223 d, err := proftest.Diff(got, want)
224 if err != nil {
225 t.Fatalf("error finding diff: %v", err)
226 }
227 t.Errorf("Compose incorrectly wrote %s", string(d))
228 if *updateFlag {
229 err := os.WriteFile(wantFile, got, 0644)
230 if err != nil {
231 t.Errorf("failed to update the golden file %q: %v", wantFile, err)
232 }
233 }
234 }
235}
236
237func TestNodeletCountCapping(t *testing.T) {
238 labelTags := make(TagMap)

Calls 1

DiffFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…