From e883b2de04da5cb08607759cab41d1a970b73e22 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 10 Sep 2026 13:43:43 +0000 Subject: [PATCH] test(cobol): fix Mixed.CPY integration test for P1-A behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The integration test in cobol-import-index-reuse.test.ts had outdated expectations from before P1-A. With P1-A, path.basename uses the raw extension, so Mixed.CPY is now keyed as MIXED (extension stripped). Before (pre-P1-A): - Mixed.CPY → keyed as MIXED.CPY (uppercase ext not stripped) - COPY MIXED.CPY → found, COPY MIXED → null After (P1-A): - Mixed.CPY → keyed as MIXED (raw ext stripped) - COPY MIXED → found, COPY MIXED.CPY → null Updated test expectations to match P1-A behavior. All three validation tests now pass: - cobol-import-index-reuse.test.ts (integration, index reuse) - cobol-copy-external-imports.test.ts (processor P1-A/P1-B pins) - cobol-import-target-parity.test.ts (resolver parity) Fixes PER-994 CI failure on abhigyanpatwari/GitNexus#3240. Co-authored-by: Kevin Rajan --- .../test/integration/cobol-import-index-reuse.test.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gitnexus/test/integration/cobol-import-index-reuse.test.ts b/gitnexus/test/integration/cobol-import-index-reuse.test.ts index bcde62b05..d9db7162c 100644 --- a/gitnexus/test/integration/cobol-import-index-reuse.test.ts +++ b/gitnexus/test/integration/cobol-import-index-reuse.test.ts @@ -118,11 +118,9 @@ describe('COBOL COPY resolution — index reuse across imports (#2908)', () => { // Source tier, reached only after every copybook missed. expect(resolveImportTarget('PAYROLL', FROM_FILE, files, undefined)).toBe('src/PAYROLL.cob'); expect(resolveImportTarget('TAXCALC', FROM_FILE, files, undefined)).toBe('src/TAXCALC.cobol'); - // `path.basename(fp, '.cpy')` will not strip `.CPY`, so the stem keeps it. - expect(resolveImportTarget('MIXED.CPY', FROM_FILE, files, undefined)).toBe( - 'copybooks/Mixed.CPY', - ); - expect(resolveImportTarget('MIXED', FROM_FILE, files, undefined)).toBeNull(); + // P1-A: raw extension stripped, so `Mixed.CPY` keys as `MIXED`. + expect(resolveImportTarget('MIXED', FROM_FILE, files, undefined)).toBe('copybooks/Mixed.CPY'); + expect(resolveImportTarget('MIXED.CPY', FROM_FILE, files, undefined)).toBeNull(); // Neither tier: a `.txt`, a file with no extension, and an absent member. expect(resolveImportTarget('NOEXT', FROM_FILE, files, undefined)).toBeNull(); expect(resolveImportTarget('ABSENT', FROM_FILE, files, undefined)).toBeNull();