ba49f82953
- Implemented window delineation tests for indentation-based tokenization. - Created tokenizer module with various tokenization strategies including TTokenizer and ApproximateTokenizer. - Added type definitions for authentication parameters and code citation notifications. - Introduced context provider API for extensions to supply additional context items to Copilot. - Defined core types and schemas for position and range. - Established status types for agent status management in IDEs.
33 lines
996 B
TypeScript
33 lines
996 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
import { SnippetProviderType, SnippetSemantics, announceSnippet } from '../snippetInclusion/snippets';
|
|
import * as assert from 'assert';
|
|
import dedent from 'ts-dedent';
|
|
|
|
suite('Unit tests for snippet.ts', () => {
|
|
const bogusSnippet = {
|
|
relativePath: 'snippet1.ts',
|
|
score: 1.0,
|
|
startLine: 1,
|
|
endLine: 3,
|
|
provider: SnippetProviderType.Path,
|
|
semantics: SnippetSemantics.Snippet,
|
|
snippet: dedent`
|
|
A
|
|
B
|
|
C`,
|
|
};
|
|
|
|
test('announceSnippet', function () {
|
|
assert.deepStrictEqual(announceSnippet(bogusSnippet), {
|
|
headline: 'Compare this snippet from snippet1.ts:',
|
|
snippet: dedent`
|
|
A
|
|
B
|
|
C`,
|
|
});
|
|
});
|
|
});
|