From b63e37193630b6fcdf220cdf9a74d95c0e7cf256 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Mon, 25 Nov 2024 17:49:40 -0800 Subject: [PATCH] test: autocomplete --- core/autocomplete/filtering/test/testCases.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/autocomplete/filtering/test/testCases.ts b/core/autocomplete/filtering/test/testCases.ts index 5e708d910..33924b1b3 100644 --- a/core/autocomplete/filtering/test/testCases.ts +++ b/core/autocomplete/filtering/test/testCases.ts @@ -313,6 +313,26 @@ export const Timer = () => { expectedCompletion: undefined, filename: "Timer.tsx", }, + { + description: "Should autocomplete simple return statement in TypeScript", + filename: "file.ts", + input: ` + multiply(number) { + this.result *= number; + return <|fim|> + } + + divide(number) { + if (number === 0) { + throw new Error("Cannot divide by zero"); + } + this.result /= number; + return this; + } +`, + llmOutput: ` this;`, + expectedCompletion: `this;`, + }, ]; export const TEST_CASES_WITHOUT_DIFF: AutocompleteFileringTestInput[] = [