mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-20 23:10:48 -07:00
chore: update test
This commit is contained in:
@@ -19,6 +19,12 @@ describe('formatArgsPattern', () => {
|
||||
expect(formatArgsPattern(pattern)).toBe('git diff*');
|
||||
});
|
||||
|
||||
it('should parse commandPrefix with escaped quotes (git show)', () => {
|
||||
// buildArgsPatterns uses escapeRegex() which escapes quotes to \"
|
||||
const pattern = new RegExp('\\"command\\":\\"git\\ show(?:[\\s"]|\\\\")');
|
||||
expect(formatArgsPattern(pattern)).toBe('git show*');
|
||||
});
|
||||
|
||||
it('should parse commandPrefix with special chars (npm run test:ci)', () => {
|
||||
// escapeRegex escapes the colon
|
||||
const pattern = new RegExp(
|
||||
@@ -37,6 +43,11 @@ describe('formatArgsPattern', () => {
|
||||
expect(formatArgsPattern(pattern)).toBe('npm run .*');
|
||||
});
|
||||
|
||||
it('should parse commandRegex with escaped quotes', () => {
|
||||
const pattern = new RegExp('\\"command\\":\\"npm run .*');
|
||||
expect(formatArgsPattern(pattern)).toBe('npm run .*');
|
||||
});
|
||||
|
||||
it('should parse file_path pattern', () => {
|
||||
const pattern = new RegExp('"file_path":".*\\/plans\\/.*"');
|
||||
expect(formatArgsPattern(pattern)).toBe('path: .*\\/plans\\/.*');
|
||||
|
||||
Reference in New Issue
Block a user