From b87849804c03aa244956a6f90a8d9c4e176a1b1b Mon Sep 17 00:00:00 2001 From: dualfroz Date: Wed, 23 Sep 2026 06:25:40 +0200 Subject: [PATCH] test(cursor): expect the astral pair to be whole in the mixed-character selection --- src/test/integ/multi-byte-chars.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/integ/multi-byte-chars.test.ts b/src/test/integ/multi-byte-chars.test.ts index 73354ce..7db3dae 100644 --- a/src/test/integ/multi-byte-chars.test.ts +++ b/src/test/integ/multi-byte-chars.test.ts @@ -327,8 +327,10 @@ describe("Multi-width characters", () => { await sendVSCodeKeys("v"); await assertContent({ vsCodeSelections: [new vscode.Selection(0, 0, 0, 1)] }, client); + // the cursor sits on the astral char, whose two UTF-16 units both belong to + // the selection: a, the modifier letter and the pair take offsets 0 to 4 await sendVSCodeKeys("ll"); - await assertContent({ vsCodeSelections: [new vscode.Selection(0, 0, 0, 3)] }, client); + await assertContent({ vsCodeSelections: [new vscode.Selection(0, 0, 0, 4)] }, client); await sendVSCodeKeys("l"); await assertContent({ vsCodeSelections: [new vscode.Selection(0, 0, 0, 5)] }, client);