mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-15 04:18:05 +00:00
Adds the tests for the R caller-attribution fix BEFORE the fix, so the fix commit only flips them to normal tests. Defect: R's @scope.function anchors on the function_definition while @declaration.function / @declaration.method anchor on the enclosing assignment or method argument. The def is therefore owned by the Module / outer-function / Class scope, and resolveCallerGraphId credits every call in a body to the FIRST callable that scope owns (false inner -> inner self-loops, R6 calls credited to the class's first method, module-level calls credited to a function not File). Contents: - test/unit/scope-resolution/r/scope-function-anchors.test.ts: scope-tree proofs via extractParsedFile + populateClassOwnedMembers (named forms, nesting, anonymous lambdas, R6/R5 methods, nested helper in a method, class-body field default, single-function file, member-assigned functions, def node id pins). - test/fixtures/lang-resolution/r-call-attribution/: synthetic fixture, a decoy first function per file, unique leaf callees. - test/integration/resolvers/r.test.ts: new 'R caller attribution' describe with exact per-source edge sets and named-type invariance counts. Assertions that fail at HEAD because of the misattribution are wrapped in it.fails (one assertion per it, value-comparing, no non-null derefs) and are unwrapped by the fix commit; assertions that already hold stay plain; each wrapped case has a plain twin (the target edge exists from any source). The step-1-only HEAD pins assert the defect itself and are deleted by the fix commit. Verified: every wrapped test fails without the wrapper at HEAD with an assertion mismatch (no throws) and passes when the query is patched with the two scope patterns; only the HEAD pins flip. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| helpers | ||
| integration | ||
| unit | ||
| utils | ||