Files
openchamber/packages/vscode/src/pathUtils.test.ts
T
pttydou ed987a576d fix(vscode): normalize status path comparison (#3322)
Closes #3308. Thanks for fixing the misleading Windows status diagnostic and adding the focused regression tests.
2026-09-05 02:13:54 +03:00

25 lines
921 B
TypeScript

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);
});
});