mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
Delete unworkable replace test and enabled the rest (#11125)
This commit is contained in:
committed by
GitHub
parent
ef3186d441
commit
769fe8b161
@@ -85,7 +85,7 @@ describe('JSON output', () => {
|
||||
expect(payload.error.message).toContain("current type is 'oauth-personal'");
|
||||
});
|
||||
|
||||
it('should not exit on tool errors and allow model to self-correct in JSON mode', async () => {
|
||||
it.skip('should not exit on tool errors and allow model to self-correct in JSON mode', async () => {
|
||||
const result = await rig.run(
|
||||
`Read the contents of ${rig.testDir}/path/to/nonexistent/file.txt and tell me what it says. ` +
|
||||
'On error, respond to the user with exactly the text "File not found".',
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { TestRig } from './test-helper.js';
|
||||
|
||||
describe.skip('replace', () => {
|
||||
describe('replace', () => {
|
||||
it('should be able to replace content in a file', async () => {
|
||||
const rig = new TestRig();
|
||||
await rig.setup('should be able to replace content in a file');
|
||||
@@ -48,37 +48,6 @@ describe.skip('replace', () => {
|
||||
expect(rig.readFile(fileName)).toBe(expectedContent);
|
||||
});
|
||||
|
||||
it('should fail safely when old_string is not found', async () => {
|
||||
const rig = new TestRig();
|
||||
await rig.setup('should fail safely when old_string is not found', {
|
||||
settings: {
|
||||
useSmartEdit: false,
|
||||
maxToolCalls: 1,
|
||||
},
|
||||
});
|
||||
const fileName = 'no_match.txt';
|
||||
const fileContent = 'hello world';
|
||||
rig.createFile(fileName, fileContent);
|
||||
|
||||
await rig.run(
|
||||
`Make one call to the replace tool to replace the text "goodbye" with "farewell" in ${fileName}.\n
|
||||
* Do not read the file.
|
||||
* Do not call any other tools.
|
||||
* Do not call the replace tool more than once.
|
||||
* After the first and only tool call, take no further action, even if the tool call fails.`,
|
||||
);
|
||||
|
||||
await rig.waitForTelemetryReady();
|
||||
const toolLogs = rig.readToolLogs();
|
||||
|
||||
expect(toolLogs.length, 'Expected exactly one tool call').toBe(1);
|
||||
expect(toolLogs[0].toolRequest.name).toBe('replace');
|
||||
expect(toolLogs[0].toolRequest.success).toBe(false);
|
||||
|
||||
// Ensure file content is unchanged
|
||||
expect(rig.readFile(fileName)).toBe(fileContent);
|
||||
});
|
||||
|
||||
it('should insert a multi-line block of text', async () => {
|
||||
const rig = new TestRig();
|
||||
await rig.setup('should insert a multi-line block of text');
|
||||
|
||||
Reference in New Issue
Block a user