mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-19 18:40:57 -07:00
fix windows escaping (and broken tests) (#19011)
This commit is contained in:
committed by
GitHub
parent
c7237f0c79
commit
e7e4c68c5c
@@ -290,8 +290,8 @@ describe('handleAtCommand', () => {
|
||||
path.join(testRootDir, 'path', 'to', 'my file.txt'),
|
||||
fileContent,
|
||||
);
|
||||
const escapedpath = path.join(testRootDir, 'path', 'to', 'my\\ file.txt');
|
||||
const query = `@${escapedpath}`;
|
||||
|
||||
const query = `@${core.escapePath(filePath)}`;
|
||||
|
||||
const result = await handleAtCommand({
|
||||
query,
|
||||
@@ -960,8 +960,8 @@ describe('handleAtCommand', () => {
|
||||
path.join(testRootDir, 'spaced file.txt'),
|
||||
fileContent,
|
||||
);
|
||||
const escapedPath = path.join(testRootDir, 'spaced\\ file.txt');
|
||||
const query = `Check @${escapedPath}, it has spaces.`;
|
||||
|
||||
const query = `Check @${core.escapePath(filePath)}, it has spaces.`;
|
||||
|
||||
const result = await handleAtCommand({
|
||||
query,
|
||||
|
||||
@@ -13,6 +13,7 @@ import type { Config, FileSearch } from '@google/gemini-cli-core';
|
||||
import {
|
||||
FileSearchFactory,
|
||||
FileDiscoveryService,
|
||||
escapePath,
|
||||
} from '@google/gemini-cli-core';
|
||||
import type { FileSystemStructure } from '@google/gemini-cli-test-utils';
|
||||
import { createTmpDir, cleanupTmpDir } from '@google/gemini-cli-test-utils';
|
||||
@@ -90,7 +91,7 @@ describe('useAtCompletion', () => {
|
||||
'src/',
|
||||
'src/components/',
|
||||
'file.txt',
|
||||
'src/components/Button\\ with\\ spaces.tsx',
|
||||
`${escapePath('src/components/Button with spaces.tsx')}`,
|
||||
'src/components/Button.tsx',
|
||||
'src/index.js',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user