var inputs … func expectation(f *ast.File) (string, token.Pos) { … } // TestCHA runs CHA on each file in inputs, prints the dynamic edges of // the call graph, and compares it with the golden results embedded in // the WANT comment at the end of the file. func TestCHA(t *testing.T) { … } // TestCHAGenerics is TestCHA tailored for testing generics, func TestCHAGenerics(t *testing.T) { … } // TestCHAUnexported tests call resolution for unexported methods. func TestCHAUnexported(t *testing.T) { … } // loadFile loads a built SSA package for a single-file "x.io/main" package. // (Ideally all uses would be converted over to txtar files with explicit go.mod files.) func loadFile(t testing.TB, filename string, mode ssa.BuilderMode) (*packages.Package, *ssa.Package) { … } // printGraph returns a string representation of cg involving only edges // whose description contains edgeMatch. The string representation is // prefixed with a desc line. func printGraph(cg *callgraph.Graph, from *types.Package, edgeMatch string, desc string) string { … }