提交 a6280ce6 编写于 作者: R Rob Lourens

Try to reenable ripgrep tests

上级 074469bf
...@@ -12,7 +12,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; ...@@ -12,7 +12,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import { FileWalker } from 'vs/workbench/services/search/node/fileSearch'; import { FileWalker } from 'vs/workbench/services/search/node/fileSearch';
import { ISerializedFileMatch, IRawSearch } from 'vs/workbench/services/search/node/search'; import { ISerializedFileMatch, IRawSearch } from 'vs/workbench/services/search/node/search';
import { Engine as TextSearchEngine } from 'vs/workbench/services/search/node/textSearch'; import { Engine as TextSearchEngine } from 'vs/workbench/services/search/node/textSearch';
// import { RipgrepEngine } from 'vs/workbench/services/search/node/ripgrepTextSearch'; import { RipgrepEngine } from 'vs/workbench/services/search/node/ripgrepTextSearch';
import { TextSearchWorkerProvider } from 'vs/workbench/services/search/node/textSearchWorkerProvider'; import { TextSearchWorkerProvider } from 'vs/workbench/services/search/node/textSearchWorkerProvider';
function countAll(matches: ISerializedFileMatch[]): number { function countAll(matches: ISerializedFileMatch[]): number {
...@@ -46,26 +46,26 @@ function doLegacySearchTest(config: IRawSearch, expectedResultCount: number | Fu ...@@ -46,26 +46,26 @@ function doLegacySearchTest(config: IRawSearch, expectedResultCount: number | Fu
}); });
} }
// function doRipgrepSearchTest(config: IRawSearch, expectedResultCount: number): TPromise<void> { function doRipgrepSearchTest(config: IRawSearch, expectedResultCount: number): TPromise<void> {
// return new TPromise<void>(resolve => { return new TPromise<void>(resolve => {
// let engine = new RipgrepEngine(config); let engine = new RipgrepEngine(config);
// let c = 0; let c = 0;
// engine.search((result) => { engine.search((result) => {
// if (result) { if (result) {
// c += result.numMatches; c += result.numMatches;
// } }
// }, () => { }, (error) => { }, () => { }, (error) => {
// assert.ok(!error); assert.ok(!error);
// assert.equal(c, expectedResultCount); assert.equal(c, expectedResultCount);
// resolve(undefined); resolve(undefined);
// }); });
// }); });
// } }
function doSearchTest(config: IRawSearch, expectedResultCount: number, done) { function doSearchTest(config: IRawSearch, expectedResultCount: number, done) {
return doLegacySearchTest(config, expectedResultCount) return doLegacySearchTest(config, expectedResultCount)
// .then(() => doRipgrepSearchTest(config, expectedResultCount)) .then(() => doRipgrepSearchTest(config, expectedResultCount))
.then(done, done); .then(done, done);
} }
...@@ -166,7 +166,7 @@ suite('Search-integration', () => { ...@@ -166,7 +166,7 @@ suite('Search-integration', () => {
// (Legacy) search can go over the maxResults because it doesn't trim the results from its worker processes to the exact max size. // (Legacy) search can go over the maxResults because it doesn't trim the results from its worker processes to the exact max size.
// But the worst-case scenario should be 2*max-1 // But the worst-case scenario should be 2*max-1
return doLegacySearchTest(config, count => count < maxResults * 2) return doLegacySearchTest(config, count => count < maxResults * 2)
// .then(() => doRipgrepSearchTest(config, maxResults)) .then(() => doRipgrepSearchTest(config, maxResults))
.then(done, done); .then(done, done);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册