Closes #3308. Thanks for fixing the misleading Windows status diagnostic and adding the focused regression tests.
25 lines
921 B
TypeScript
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);
|
|
});
|
|
});
|