From 1df9f3a84ade29f3393afbe4737f014b5ee4dde1 Mon Sep 17 00:00:00 2001 From: Dudu-0223 Date: Thu, 9 Jul 2026 22:00:43 +0800 Subject: [PATCH] test: cover the glob path arg in the fake-executor tier CI has no rg, so the integration suite self-skips there and the fake-executor suite must carry the per-file 100% coverage gate alone. parseGlobArgs's valid-path branch was only exercised by integration (node 24 / coverage failed at 95.45% branches on glob.ts); a fake-tier test now threads a valid path through to the quoted `-- 'sub'` root. --- packages/fs/tool-fs-search/tests/tools.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/fs/tool-fs-search/tests/tools.spec.ts b/packages/fs/tool-fs-search/tests/tools.spec.ts index a3a3e89cce..7abbe20638 100644 --- a/packages/fs/tool-fs-search/tests/tools.spec.ts +++ b/packages/fs/tool-fs-search/tests/tools.spec.ts @@ -459,6 +459,14 @@ describe('glob results', () => { expect(text(await call(ctx, 'glob', { pattern: '*', path: ' ' }))).toContain('path must be a non-empty string') }) + it('threads a valid path through to the command as the quoted search root', async () => { + const { ctx, bash } = await setup() + bash.handler = () => runResult('sub/a.ts\n') + const result = await call(ctx, 'glob', { pattern: '*.ts', path: 'sub' }) + expect(result.isError).toBe(false) + expect(bash.specs[0]?.command).toContain("-- 'sub'") + }) + it('caps at globMaxResults and saves the FULL sorted list through spillFiles', async () => { const { ctx, bash, spill } = await setup({ config: { globMaxResults: 2 }, spill: true }) bash.handler = () => runResult('a.ts\nb.ts\nc.ts\nd.ts\n')