Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/simulation/slash-test/testGen.cpp.stest.ts
13394 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as assert from 'assert';
7
import { Intent } from '../../../src/extension/common/constants';
8
import { ssuite, stest } from '../../base/stest';
9
import { forInline, simulateInlineChatWithStrategy } from '../inlineChatSimulator';
10
import { assertWorkspaceEdit, fromFixture } from '../stestUtil';
11
12
forInline((strategy, nonExtensionConfigurations, suffix) => {
13
14
ssuite({ title: `/tests${suffix}`, location: 'inline', language: 'cpp', nonExtensionConfigurations }, () => {
15
16
stest({ description: 'can create a new test file' }, (testingServiceCollection) => {
17
return simulateInlineChatWithStrategy(strategy, testingServiceCollection, {
18
files: [
19
fromFixture('cpp/basic/main.cpp'),
20
],
21
queries: [{
22
file: 'main.cpp',
23
selection: [10, 16],
24
query: '/tests',
25
expectedIntent: Intent.Tests,
26
validate: async (outcome, workspace, accessor) => {
27
assertWorkspaceEdit(outcome);
28
assert.strictEqual(outcome.files.length, 1);
29
}
30
}]
31
});
32
});
33
});
34
});
35
36