MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / calls

Function calls

__tests__/cpp-overload-constness.test.ts:152–156  ·  view source on GitHub ↗
(caller: string, name: string)

Source from the content-addressed store, hash-verified

150
151 /** The `name` overloads a function calls, as `name:startLine`. */
152 const calls = (caller: string, name: string): string[] => {
153 const fn = cg.getNodesByKind('function').find((n: Node) => n.name === caller);
154 expect(fn, caller).toBeDefined();
155 return cg.getCallees(fn!.id).filter((r) => r.edge.kind === 'calls' && r.node.name === name).map((r) => `${r.node.name}:${r.node.startLine}`);
156 };
157
158 it('a pointer to a non-const object takes the non-const overload, to a const one the const overload', () => {
159 expect(calls('NonConstHolder', 'DynamicCastMessage')).toEqual(['DynamicCastMessage:10']);

Callers 1

Calls 3

mapMethod · 0.80
getNodesByKindMethod · 0.65
getCalleesMethod · 0.45

Tested by

no test coverage detected