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

Function TestIsFoldedMerge

profile/profile_test.go:873–904  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

871}
872
873func TestIsFoldedMerge(t *testing.T) {
874 testProfile1Folded := testProfile1.Copy()
875 testProfile1Folded.Location[0].IsFolded = true
876 testProfile1Folded.Location[1].IsFolded = true
877
878 for _, tc := range []struct {
879 name string
880 profs []*Profile
881 wantLocationLen int
882 }{
883 {
884 name: "folded and non-folded locations not merged",
885 profs: []*Profile{testProfile1.Copy(), testProfile1Folded.Copy()},
886 wantLocationLen: 7,
887 },
888 {
889 name: "identical folded locations are merged",
890 profs: []*Profile{testProfile1Folded.Copy(), testProfile1Folded.Copy()},
891 wantLocationLen: 5,
892 },
893 } {
894 t.Run(tc.name, func(t *testing.T) {
895 prof, err := Merge(tc.profs)
896 if err != nil {
897 t.Fatalf("merge error: %v", err)
898 }
899 if got, want := len(prof.Location), tc.wantLocationLen; got != want {
900 t.Fatalf("got %d locations, want %d locations", got, want)
901 }
902 })
903 }
904}
905
906func TestNumLabelMerge(t *testing.T) {
907 for _, tc := range []struct {

Callers

nothing calls this directly

Calls 2

MergeFunction · 0.85
CopyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…