diff --git a/src/vs/workbench/test/browser/api/extHostWorkspace.test.ts b/src/vs/workbench/test/browser/api/extHostWorkspace.test.ts index b36ec55951c..a3eacd6e298 100644 --- a/src/vs/workbench/test/browser/api/extHostWorkspace.test.ts +++ b/src/vs/workbench/test/browser/api/extHostWorkspace.test.ts @@ -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 { 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', () => {