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%).
This commit is contained in:
Tianyi Cui
2026-07-11 23:55:56 +08:00
parent da9cef381c
commit bac97a5b2e
@@ -273,6 +273,12 @@ describe('formatSystemPromptSnapshot', () => {
{ keepStart: 1, keepEnd: 0, insert: ['new', 'lines'] },
])).toBe('prompt\n\n<!-- request/header-delta 1: keepStart=1, keepEnd=0 -->\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<!-- request/header-delta 1: keepStart=2, keepEnd=1 -->\n\ntail\n')
})
})
describe('headerDeltaCount', () => {