mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-15 07:41:11 +01:00
api - test relative pattern with URI
This commit is contained in:
@@ -605,7 +605,7 @@ suite('ExtHostWorkspace', function () {
|
||||
});
|
||||
});
|
||||
|
||||
test('findFiles - RelativePattern include', () => {
|
||||
function testFindFilesInclude(pattern: RelativePattern) {
|
||||
const root = '/project/foo';
|
||||
const rpcProtocol = new TestRPCProtocol();
|
||||
|
||||
@@ -614,16 +614,24 @@ suite('ExtHostWorkspace', function () {
|
||||
$startFileSearch(includePattern: string, _includeFolder: UriComponents | null, excludePatternOrDisregardExcludes: string | false, maxResults: number, token: CancellationToken): Promise<URI[] | null> {
|
||||
mainThreadCalled = true;
|
||||
assert.equal(includePattern, 'glob/**');
|
||||
assert.deepEqual(_includeFolder, URI.file('/other/folder').toJSON());
|
||||
assert.deepEqual(_includeFolder ? URI.from(_includeFolder).toJSON() : null, URI.file('/other/folder').toJSON());
|
||||
assert.equal(excludePatternOrDisregardExcludes, null);
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
});
|
||||
|
||||
const ws = createExtHostWorkspace(rpcProtocol, { id: 'foo', folders: [aWorkspaceFolderData(URI.file(root), 0)], name: 'Test' }, new NullLogService());
|
||||
return ws.findFiles(new RelativePattern('/other/folder', 'glob/**'), undefined, 10, new ExtensionIdentifier('test')).then(() => {
|
||||
return ws.findFiles(pattern, undefined, 10, new ExtensionIdentifier('test')).then(() => {
|
||||
assert(mainThreadCalled, 'mainThreadCalled');
|
||||
});
|
||||
}
|
||||
|
||||
test('findFiles - RelativePattern include (string)', () => {
|
||||
return testFindFilesInclude(new RelativePattern('/other/folder', 'glob/**'));
|
||||
});
|
||||
|
||||
test('findFiles - RelativePattern include (URI)', () => {
|
||||
return testFindFilesInclude(new RelativePattern(URI.file('/other/folder'), 'glob/**'));
|
||||
});
|
||||
|
||||
test('findFiles - no excludes', () => {
|
||||
|
||||
Reference in New Issue
Block a user