|
1 | 1 | import assert from 'node:assert'; |
| 2 | +import * as path from 'node:path'; |
2 | 3 | import * as sinon from 'sinon'; |
3 | 4 | import { Uri } from 'vscode'; |
4 | 5 | import * as logging from '../../../common/logging'; |
@@ -587,23 +588,20 @@ suite('getAllExtraSearchPaths Integration Tests', () => { |
587 | 588 | const result = await getAllExtraSearchPaths(); |
588 | 589 |
|
589 | 590 | // Assert - relative paths resolved only against their own folder |
| 591 | + const expected1 = path.resolve(workspace1.fsPath, 'envs').replace(/\\/g, '/'); |
| 592 | + const expected2 = path.resolve(workspace2.fsPath, 'venvs').replace(/\\/g, '/'); |
| 593 | + const wrong1In2 = path.resolve(workspace2.fsPath, 'envs').replace(/\\/g, '/'); |
| 594 | + const wrong2In1 = path.resolve(workspace1.fsPath, 'venvs').replace(/\\/g, '/'); |
| 595 | + |
590 | 596 | assert.strictEqual(result.length, 2, 'Should have exactly 2 paths (one per folder)'); |
| 597 | + assert.ok(result.includes(expected1), 'project1/envs should come from project1 config'); |
| 598 | + assert.ok(result.includes(expected2), 'project2/venvs should come from project2 config'); |
591 | 599 | assert.ok( |
592 | | - result.some((p) => p.includes('project1') && p.endsWith('/envs')), |
593 | | - 'project1/envs should come from project1 config', |
594 | | - ); |
595 | | - assert.ok( |
596 | | - result.some((p) => p.includes('project2') && p.endsWith('/venvs')), |
597 | | - 'project2/venvs should come from project2 config', |
598 | | - ); |
599 | | - // project1 relative path must NOT be resolved against project2 |
600 | | - assert.ok( |
601 | | - !result.some((p) => p.includes('project2') && p.endsWith('/envs')), |
| 600 | + !result.includes(wrong1In2), |
602 | 601 | 'project1 relative path should not be resolved against project2', |
603 | 602 | ); |
604 | | - // project2 relative path must NOT be resolved against project1 |
605 | 603 | assert.ok( |
606 | | - !result.some((p) => p.includes('project1') && p.endsWith('/venvs')), |
| 604 | + !result.includes(wrong2In1), |
607 | 605 | 'project2 relative path should not be resolved against project1', |
608 | 606 | ); |
609 | 607 | }); |
|
0 commit comments