mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
Refactor read-file and support images. (#480)
This commit is contained in:
parent
f21abdd1f0
commit
dab7517622
13 changed files with 1475 additions and 260 deletions
|
|
@ -115,6 +115,33 @@ describe('ReadManyFilesTool', () => {
|
|||
};
|
||||
expect(tool.validateParams(params)).toBeNull();
|
||||
});
|
||||
|
||||
it('should return error if paths array contains an empty string', () => {
|
||||
const params = { paths: ['file1.txt', ''] };
|
||||
expect(tool.validateParams(params)).toBe(
|
||||
'Each item in "paths" must be a non-empty string/glob pattern.',
|
||||
);
|
||||
});
|
||||
|
||||
it('should return error if include array contains non-string elements', () => {
|
||||
const params = {
|
||||
paths: ['file1.txt'],
|
||||
include: ['*.ts', 123] as string[],
|
||||
};
|
||||
expect(tool.validateParams(params)).toBe(
|
||||
'If provided, "include" must be an array of strings/glob patterns.',
|
||||
);
|
||||
});
|
||||
|
||||
it('should return error if exclude array contains non-string elements', () => {
|
||||
const params = {
|
||||
paths: ['file1.txt'],
|
||||
exclude: ['*.log', {}] as string[],
|
||||
};
|
||||
expect(tool.validateParams(params)).toBe(
|
||||
'If provided, "exclude" must be an array of strings/glob patterns.',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('execute', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue