mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
test: add larger image test for read tool
This commit is contained in:
parent
7d2bb5cb2b
commit
d5f0e3fccc
BIN
packages/opencode/test/tool/fixtures/large-image.png
Normal file
BIN
packages/opencode/test/tool/fixtures/large-image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
@ -286,4 +286,18 @@ describe("tool.read truncation", () => {
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test("large image files are properly attached without error", async () => {
|
||||
await Instance.provide({
|
||||
directory: FIXTURES_DIR,
|
||||
fn: async () => {
|
||||
const read = await ReadTool.init()
|
||||
const result = await read.execute({ filePath: path.join(FIXTURES_DIR, "large-image.png") }, ctx)
|
||||
expect(result.metadata.truncated).toBe(false)
|
||||
expect(result.attachments).toBeDefined()
|
||||
expect(result.attachments?.length).toBe(1)
|
||||
expect(result.attachments?.[0].type).toBe("file")
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user