Path: blob/main/extensions/copilot/src/platform/parser/test/node/getStructure.rust.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 - rust', () => {11afterAll(() => _dispose());1213function rustStruct(source: string) {14return srcWithAnnotatedStructure(WASMLanguage.Rust, source);15}1617test('source with different syntax constructs', async () => {1819const file = 'test.rs';2021const source = await fromFixture(file);2223await expect(await rustStruct(source)).toMatchFileSnapshot(snapshotPathInFixture(file));24});2526});272829