Skip to content

Commit 4be0ee1

Browse files
committed
Fix tests
1 parent cc589f9 commit 4be0ee1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vs/workbench/contrib/terminalContrib/links/test/browser/linkTestUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export async function assertLinkHelper(
1818

1919
// Write the text and wait for the parser to finish
2020
await new Promise<void>(r => detector.xterm.write(text, r));
21+
const textSplit = text.split('\r\n');
22+
const lastLineIndex = textSplit.filter((e, i) => i !== textSplit.length - 1).reduce((p, c) => {
23+
return p + Math.max(Math.ceil(c.length / 80), 1);
24+
}, 0);
2125

2226
// Ensure all links are provided
2327
const lines: IBufferLine[] = [];
@@ -26,7 +30,7 @@ export async function assertLinkHelper(
2630
}
2731

2832
// Detect links always on the last line with content
29-
const actualLinks = (await detector.detect(lines, detector.xterm.buffer.active.cursorY, detector.xterm.buffer.active.cursorY)).map(e => {
33+
const actualLinks = (await detector.detect(lines, lastLineIndex, detector.xterm.buffer.active.cursorY)).map(e => {
3034
return {
3135
link: e.uri?.toString() ?? e.text,
3236
type: expectedType,

0 commit comments

Comments
 (0)