Files
openidea/src/features/debugger/editor/runToCursor.test.ts
T
l0ng-ai 4dcf0acc07 feat(debugger): Show a Run to Cursor button when hovering a line while paused (#168)
While the debugger is suspended, hovering the start of a line shows a small
button left of its text: Run to Cursor runs to that line, and on the execution
line it resumes the program. Settings › Debugger › Show inlay Run to Cursor popup
turns it off.
2026-10-29 04:09:28 +08:00

16 lines
649 B
TypeScript

import { describe, expect, it } from "vitest";
import { hoveredLine } from "./runToCursor";
describe("inlay Run to Cursor", () => {
const line = { number: 3, text: " foo()" };
it("targets a non-blank line when hovering its first characters", () => {
expect(hoveredLine(100, 8, 100, line)).toBe(2);
expect(hoveredLine(100, 8, 132, line)).toBe(2);
});
it("ignores the pointer further right, left of the text, and blank lines", () => {
expect(hoveredLine(100, 8, 133, line)).toBeNull();
expect(hoveredLine(100, 8, 99, line)).toBeNull();
expect(hoveredLine(100, 8, 104, { number: 4, text: " " })).toBeNull();
});
});