mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-01 08:51:11 -07:00
fix: make @file suggestions case-insensitive (#11394)
This commit is contained in:
@@ -138,6 +138,39 @@ describe('useAtCompletion', () => {
|
||||
'file.txt',
|
||||
]);
|
||||
});
|
||||
|
||||
it('should perform a case-insensitive search by lowercasing the pattern', async () => {
|
||||
testRootDir = await createTmpDir({ 'cRaZycAsE.txt': '' });
|
||||
|
||||
const fileSearch = FileSearchFactory.create({
|
||||
projectRoot: testRootDir,
|
||||
ignoreDirs: [],
|
||||
useGitignore: false,
|
||||
useGeminiignore: false,
|
||||
cache: false,
|
||||
enableRecursiveFileSearch: true,
|
||||
disableFuzzySearch: false,
|
||||
});
|
||||
await fileSearch.initialize();
|
||||
|
||||
vi.spyOn(FileSearchFactory, 'create').mockReturnValue(fileSearch);
|
||||
|
||||
const { result } = renderHook(() =>
|
||||
useTestHarnessForAtCompletion(
|
||||
true,
|
||||
'CrAzYCaSe',
|
||||
mockConfig,
|
||||
testRootDir,
|
||||
),
|
||||
);
|
||||
|
||||
// The hook should find 'cRaZycAsE.txt' even though the pattern is 'CrAzYCaSe'.
|
||||
await waitFor(() => {
|
||||
expect(result.current.suggestions.map((s) => s.value)).toEqual([
|
||||
'cRaZycAsE.txt',
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('UI State and Loading Behavior', () => {
|
||||
|
||||
Reference in New Issue
Block a user