mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 17:41:24 -07:00
Properly parse at-commands with narrow non-breaking spaces (#18677)
This commit is contained in:
committed by
GitHub
parent
cc2798018b
commit
eb94284256
@@ -319,6 +319,35 @@ describe('handleAtCommand', () => {
|
||||
);
|
||||
}, 10000);
|
||||
|
||||
it('should correctly handle file paths with narrow non-breaking space (NNBSP)', async () => {
|
||||
const nnbsp = '\u202F';
|
||||
const fileContent = 'NNBSP file content.';
|
||||
const filePath = await createTestFile(
|
||||
path.join(testRootDir, `my${nnbsp}file.txt`),
|
||||
fileContent,
|
||||
);
|
||||
const relativePath = getRelativePath(filePath);
|
||||
const query = `@${filePath}`;
|
||||
|
||||
const result = await handleAtCommand({
|
||||
query,
|
||||
config: mockConfig,
|
||||
addItem: mockAddItem,
|
||||
onDebugMessage: mockOnDebugMessage,
|
||||
messageId: 129,
|
||||
signal: abortController.signal,
|
||||
});
|
||||
|
||||
expect(result.error).toBeUndefined();
|
||||
expect(result.processedQuery).toEqual([
|
||||
{ text: `@${relativePath}` },
|
||||
{ text: '\n--- Content from referenced files ---' },
|
||||
{ text: `\nContent from @${relativePath}:\n` },
|
||||
{ text: fileContent },
|
||||
{ text: '\n--- End of content ---' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('should handle multiple @file references', async () => {
|
||||
const content1 = 'Content file1';
|
||||
const file1Path = await createTestFile(
|
||||
|
||||
Reference in New Issue
Block a user