Path: blob/main/extensions/copilot/src/platform/parser/test/node/getStructure.java.spec.ts
13405 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { afterAll, describe, expect, test } from 'vitest';6import { _dispose } from '../../node/parserImpl';7import { WASMLanguage } from '../../node/treeSitterLanguages';8import { fromFixture, snapshotPathInFixture, srcWithAnnotatedStructure } from './getStructure.util';910describe('getStructure - java', () => {11afterAll(() => _dispose());1213function javaSrcWithStructure(source: string) {14return srcWithAnnotatedStructure(WASMLanguage.Java, source);15}1617test('java source with different syntax constructs', async () => {1819const filename = 'test.java';2021const source = await fromFixture(filename);2223await expect(await javaSrcWithStructure(source)).toMatchFileSnapshot(snapshotPathInFixture(filename));24});2526});272829