提交 2e8bbdb4 编写于 作者: B Benjamin Pasero

api - test relative pattern with URI

上级 2be5cc18
......@@ -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', () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册