From 9deaf5fe6171e9936b7ffb1d14904d0c9cfea0ad Mon Sep 17 00:00:00 2001 From: azizur100389 Date: Thu, 5 Nov 2026 10:58:48 +0000 Subject: [PATCH] test(model): cover same-name Class and Impl isolation --- .../test/fixtures/scenario-map-recall/audit.json | 6 ------ gitnexus/test/unit/model/registration-table.test.ts | 13 ++++++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gitnexus/test/fixtures/scenario-map-recall/audit.json b/gitnexus/test/fixtures/scenario-map-recall/audit.json index f71daafb6..7ca94f2b8 100644 --- a/gitnexus/test/fixtures/scenario-map-recall/audit.json +++ b/gitnexus/test/fixtures/scenario-map-recall/audit.json @@ -350,12 +350,6 @@ "category": "same-file", "basis": "Identical scenario body in one file, using the same helpers, input data and assertions. Enclosing setup has no relevant difference." }, - { - "a": "test/unit/model/registration-table.test.ts#behavior group isolation > Impl hooks write to types.registerImpl, never to types.registerClass", - "b": "test/unit/model/registration-table.test.ts#hook behavior (real registries, no mocks) > implHook writes to types.registerImpl, NOT types.registerClass", - "category": "same-file", - "basis": "Identical scenario body in one file, using the same helpers, input data and assertions. Enclosing setup has no relevant difference." - }, { "a": "test/unit/scope-resolution/function-local-import-chain.test.ts#Python: a function-local import reaches the IMPORTS reason > `def f(): from m import X` is deferred", "b": "test/unit/scope-resolution/function-local-import-chain.test.ts#Rust: a function-local `use` is NOT deferred > Python still defers on the same run", diff --git a/gitnexus/test/unit/model/registration-table.test.ts b/gitnexus/test/unit/model/registration-table.test.ts index d6ccc4100..37c23cf86 100644 --- a/gitnexus/test/unit/model/registration-table.test.ts +++ b/gitnexus/test/unit/model/registration-table.test.ts @@ -200,13 +200,16 @@ describe('behavior group isolation', () => { expect(deps.fields.lookupFieldByOwner('unrelated', 'User')).toBeUndefined(); }); - it('Impl hooks write to types.registerImpl, never to types.registerClass', () => { + it('keeps an existing Class separate from a same-name Impl', () => { const deps = makeDeps(); const table = createRegistrationTable(deps); - const def = makeDef({ nodeId: 'impl:User', type: 'Impl' }); - table.get('Impl')!('User', def); - expect(deps.types.lookupImplByName('User')).toHaveLength(1); - expect(deps.types.lookupClassByName('User')).toHaveLength(0); + const classDef = makeDef({ nodeId: 'class:User', type: 'Class', qualifiedName: 'app.User' }); + const implDef = makeDef({ nodeId: 'impl:User', type: 'Impl' }); + table.get('Class')!('User', classDef); + table.get('Impl')!('User', implDef); + expect(deps.types.lookupClassByName('User')).toEqual([classDef]); + expect(deps.types.lookupClassByQualifiedName('app.User')).toEqual([classDef]); + expect(deps.types.lookupImplByName('User')).toEqual([implDef]); }); });