fix(vscode): normalize status path comparison (#3322)

Closes #3308. Thanks for fixing the misleading Windows status diagnostic and adding the focused regression tests.
This commit is contained in:
pttydou
2026-09-05 02:13:54 +03:00
committed by GitHub
parent 188c7aa369
commit ed987a576d
3 changed files with 31 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
import assert from 'node:assert/strict';
import { describe, test } from 'node:test';
import { pathsEqualWithNormalizedDriveLetter } from './pathUtils';
describe('pathsEqualWithNormalizedDriveLetter', () => {
test('matches Windows paths that differ only in drive-letter case', () => {
assert.equal(
pathsEqualWithNormalizedDriveLetter('C:\\Users\\user\\project', 'c:\\Users\\user\\project'),
true
);
});
test('does not ignore case outside the drive letter', () => {
assert.equal(
pathsEqualWithNormalizedDriveLetter('C:\\Users\\user\\project', 'C:\\Users\\User\\project'),
false
);
});
test('preserves exact comparison for paths without a Windows drive letter', () => {
assert.equal(pathsEqualWithNormalizedDriveLetter('/work/project', '/work/project'), true);
assert.equal(pathsEqualWithNormalizedDriveLetter('/work/project', '/work/other'), false);
});
});