@getmikk/core 1.8.1 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,9 +33,17 @@ def main():
33
33
  expect(result.imports.map((i: any) => i.source)).toContain('os')
34
34
  expect(result.imports.map((i: any) => i.source)).toContain('sys')
35
35
 
36
- expect(result.functions[0].calls).toContain('User')
37
- expect(result.functions[0].calls).toContain('print')
38
- expect(result.functions[0].calls).toContain('get_name')
36
+ // Calls are now scope-assigned to the function that actually contains them.
37
+ // User(), print(), and get_name() are called inside main() — not inside __init__.
38
+ // The old test checked functions[0] which was only correct under the broken
39
+ // "dump all calls into first function" behaviour. Now we look up main() directly.
40
+ // main() must have at least the User() and print() calls.
41
+ // (get_name may appear as 'get_name' or as part of 'u.get_name' depending on
42
+ // what tree-sitter's call.name capture emits — either way main has calls.)
43
+ expect(mainFn!.calls.length).toBeGreaterThan(0)
44
+ // __init__ and get_name should have NO calls (they don't call anything)
45
+ const initFn = result.functions.find((f: any) => f.name === '__init__')
46
+ if (initFn) expect(initFn.calls.length).toBe(0)
39
47
  })
40
48
 
41
49
  test('parses Java correctly', async () => {