Skip to content

Commit

Permalink
refactor: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Oct 23, 2023
1 parent b99dcbb commit b5f0523
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/language/lsp/safe-ds-inlay-hint-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,13 @@ describe('SafeDsInlayHintProvider', async () => {
];

it.each(testCases)('should assign the correct inlay hints ($testName)', async ({ code }) => {
await checkInlayHints(code);
const actualInlayHints = await getActualInlayHints(code);
const expectedInlayHints = getExpectedInlayHints(code);

expect(actualInlayHints).toStrictEqual(expectedInlayHints);
});
});

const checkInlayHints = async (code: string) => {
const actualInlayHints = await getActualInlayHints(code);
const expectedInlayHints = getExpectedInlayHints(code);

expect(actualInlayHints).toStrictEqual(expectedInlayHints);
};

const getActualInlayHints = async (code: string): Promise<SimpleInlayHint[] | undefined> => {
const document = await parse(code);
const inlayHints = await inlayHintProvider.getInlayHints(document, {
Expand All @@ -127,7 +123,7 @@ const getActualInlayHints = async (code: string): Promise<SimpleInlayHint[] | un
};

const getExpectedInlayHints = (code: string): SimpleInlayHint[] => {
const testChecks = findTestChecks(code, URI.file('test.sdstest'), { failIfFewerRangesThanComments: true });
const testChecks = findTestChecks(code, URI.file('file:///test.sdstest'), { failIfFewerRangesThanComments: true });
if (testChecks.isErr) {
throw new Error(testChecks.error.message);
}
Expand Down

0 comments on commit b5f0523

Please sign in to comment.