The `calls` targets of function `fn` in `file`, as ` : `, sorted.
(graph: CodeGraph, file: string, fn: string)
| 40 | |
| 41 | /** The `calls` targets of function `fn` in `file`, as `<file>:<qualified name>`, sorted. */ |
| 42 | function callsOf(graph: CodeGraph, file: string, fn: string): string[] { |
| 43 | const node = graph.getNodesInFile(file).find((n) => n.name === fn && (n.kind === 'function' || n.kind === 'method')); |
| 44 | expect(node, `${file}:${fn}`).toBeDefined(); |
| 45 | return graph.getOutgoingEdges(node!.id) |
| 46 | .filter((e) => e.kind === 'calls') |
| 47 | .map((e) => { |
| 48 | const t = graph.getNode(e.target)!; |
| 49 | return `${t.filePath}:${t.qualifiedName}`; |
| 50 | }) |
| 51 | .sort(); |
| 52 | } |
| 53 | |
| 54 | const GZIP = 'pub fn read() -> u8 {\n 1\n}\n\npub fn write() {}\n'; |
| 55 |
no test coverage detected