mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-03 22:56:48 -07:00
fix(core): ensure sandbox approvals are correctly persisted and matched for proactive expansions (#24577)
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
parseCommandDetails,
|
||||
splitCommands,
|
||||
stripShellWrapper,
|
||||
normalizeCommand,
|
||||
hasRedirection,
|
||||
resolveExecutable,
|
||||
} from './shell-utils.js';
|
||||
@@ -115,6 +116,23 @@ const mockPowerShellResult = (
|
||||
});
|
||||
};
|
||||
|
||||
describe('normalizeCommand', () => {
|
||||
it('should lowercase the command', () => {
|
||||
expect(normalizeCommand('NPM')).toBe('npm');
|
||||
});
|
||||
|
||||
it('should remove .exe extension', () => {
|
||||
expect(normalizeCommand('node.exe')).toBe('node');
|
||||
});
|
||||
|
||||
it('should handle absolute paths', () => {
|
||||
expect(normalizeCommand('/usr/bin/npm')).toBe('npm');
|
||||
expect(normalizeCommand('C:\\Program Files\\nodejs\\node.exe')).toBe(
|
||||
'node',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getCommandRoots', () => {
|
||||
it('should return a single command', () => {
|
||||
expect(getCommandRoots('ls -l')).toEqual(['ls']);
|
||||
|
||||
Reference in New Issue
Block a user