Skip to content

Commit 8af1f08

Browse files
committed
Test BigInt-valued quick-eval
1 parent ac60ba3 commit 8af1f08

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

extensions/ql-vscode/test/data/debugger/QuickEvalLib.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ abstract class InterestingNumber extends TNumber
1717
final int getValue() {
1818
result = value
1919
}
20+
21+
QlBuiltins::BigInt getBigIntValue() {
22+
result = value.toBigInt()
23+
}
2024
}

extensions/ql-vscode/test/vscode-tests/cli-integration/debugger/debugger.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,25 @@ describeWithCodeQL()("Debugger", () => {
144144
});
145145
});
146146

147+
it("should run a quick evaluation with a bigint-valued result column", async () => {
148+
await withDebugController(appCommands, async (controller) => {
149+
await selectForQuickEval(quickEvalLibPath, 20, 23, 20, 37);
150+
151+
await controller.startDebuggingSelection({
152+
query: quickEvalQueryPath, // The query context. This query extends the abstract class.
153+
});
154+
await controller.expectLaunched();
155+
const result = await controller.expectSucceeded();
156+
expect(result.started.quickEvalContext).toBeDefined();
157+
expect(result.started.quickEvalContext!.quickEvalText).toBe(
158+
"getBigIntValue",
159+
);
160+
expect(result.results.queryTarget.quickEvalPosition).toBeDefined();
161+
expect(await getResultCount(result.results.outputDir, cli)).toBe(8);
162+
await controller.expectStopped();
163+
});
164+
});
165+
147166
it("should save dirty documents before launching a debug session", async () => {
148167
await withDebugController(appCommands, async (controller) => {
149168
const editor = await selectForQuickEval(quickEvalLibPath, 4, 15, 4, 32);

0 commit comments

Comments
 (0)