(content: string)
| 37 | } |
| 38 | |
| 39 | function toolWithContent(content: string): ReadTool { |
| 40 | const bytes = Buffer.from(content, 'utf8'); |
| 41 | return new ReadTool( |
| 42 | createFakeKaos({ |
| 43 | stat: vi.fn<Kaos['stat']>().mockResolvedValue(REGULAR_FILE_STAT), |
| 44 | readBytes: vi.fn<Kaos['readBytes']>().mockImplementation(async (_path, n) => { |
| 45 | return n === undefined ? bytes : bytes.subarray(0, n); |
| 46 | }), |
| 47 | readLines: vi.fn<Kaos['readLines']>().mockImplementation(readLinesFromContent(content)), |
| 48 | }), |
| 49 | PERMISSIVE_WORKSPACE, |
| 50 | ); |
| 51 | } |
| 52 | |
| 53 | describe('ReadTool — total-lines message channel', () => { |
| 54 | it('reports the file total in the status message even with a positive line_offset window', async () => { |
no test coverage detected