新增测试Windows路径能正常缩短

输入C:\Users\test\project\src\index.ts
输出🔧 Read  …/project/src/index.ts
This commit is contained in:
Raphaelowo 2026-07-14 01:55:18 +08:00 committed by GitHub
parent d79959c355
commit e5ba5d5a07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,8 +118,15 @@ describe('formatToolUse', () => {
expect(result).toBe('🔧 Read …/project/src/index.ts')
})
it('shortens Windows paths in file tool summaries', () => {
const result = formatToolUse('Read', {file_path: 'C:\\Users\\test\\project\\src\\index.ts'})
expect(result).toBe('🔧 Read …/project/src/index.ts')
})
})
describe('formatPermissionRequest', () => {
it('includes tool name, input preview, and request ID', () => {
const result = formatPermissionRequest('Bash', { command: 'rm -rf /' }, 'abcde')