Skip to content

Commit 156116b

Browse files
committed
test: add native call-edge preservation check (#1902)
docs check acknowledged — test-only change, no behavior affected.
1 parent 19aa6fd commit 156116b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/integration/issue-1773-destructured-binding-kind.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,27 @@ describe.skipIf(!isNativeAvailable())(
159159
it('classifies renamed and non-renamed destructured bindings as kind constant, not dead-unresolved', () => {
160160
expectFixedKindAndRole(path.join(tmpDir, '.codegraph', 'graph.db'));
161161
});
162+
163+
it('still resolves calls made through a destructured callback-style binding', () => {
164+
// `flags.runs`/`flags.model` are property reads, not calls, but `flags`
165+
// itself must still show up as the attributed caller of `parseArgs` — the
166+
// fix must not break caller attribution for the top-level binding.
167+
const dbPath = path.join(tmpDir, '.codegraph', 'graph.db');
168+
const db = new Database(dbPath, { readonly: true });
169+
try {
170+
const row = db
171+
.prepare(
172+
`SELECT COUNT(*) AS cnt
173+
FROM edges e
174+
JOIN nodes s ON e.source_id = s.id
175+
JOIN nodes t ON e.target_id = t.id
176+
WHERE s.name = 'flags' AND t.name = 'parseArgs' AND e.kind = 'calls'`,
177+
)
178+
.get() as { cnt: number };
179+
expect(row.cnt, 'expected flags -> parseArgs calls edge to survive the kind fix').toBe(1);
180+
} finally {
181+
db.close();
182+
}
183+
});
162184
},
163185
);

0 commit comments

Comments
 (0)