From bac97a5b2e1ae105eaa3a50c3aa131f8ead02fbb Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Sat, 11 Jul 2026 23:55:56 +0800 Subject: [PATCH] test(acp-snapshot): cover the delta-insert trailing-newline branch formatSystemPromptSnapshot's insert-join ternary had its already-newline- terminated arm unexercised (a delta whose insert ends in a blank line), failing the per-file 100% branch gate on suite.ts (99.24%). --- packages/support/acp-snapshot/tests/suite.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/support/acp-snapshot/tests/suite.spec.ts b/packages/support/acp-snapshot/tests/suite.spec.ts index dc6b71ea00..d6e3e2b912 100644 --- a/packages/support/acp-snapshot/tests/suite.spec.ts +++ b/packages/support/acp-snapshot/tests/suite.spec.ts @@ -273,6 +273,12 @@ describe('formatSystemPromptSnapshot', () => { { keepStart: 1, keepEnd: 0, insert: ['new', 'lines'] }, ])).toBe('prompt\n\n\n\nnew\nlines\n') }) + + it('does not double the newline of a delta insert with a trailing blank line', () => { + expect(formatSystemPromptSnapshot('prompt\n', [ + { keepStart: 2, keepEnd: 1, insert: ['tail', ''] }, + ])).toBe('prompt\n\n\n\ntail\n') + }) }) describe('headerDeltaCount', () => {