From dc77bca3cbc47cf6e722f4c764116e5e596e9609 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 10 Feb 2020 16:27:22 -0800 Subject: [PATCH] Fix build --- .../search/test/node/rawSearchService.test.ts | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/services/search/test/node/rawSearchService.test.ts b/src/vs/workbench/services/search/test/node/rawSearchService.test.ts index 93cf3ecbb91..1d8bdda98df 100644 --- a/src/vs/workbench/services/search/test/node/rawSearchService.test.ts +++ b/src/vs/workbench/services/search/test/node/rawSearchService.test.ts @@ -36,7 +36,7 @@ class TestSearchEngine implements ISearchEngine { private isCanceled = false; - constructor(private result: () => IRawFileMatch, public config?: IFileQuery) { + constructor(private result: () => IRawFileMatch | null, public config?: IFileQuery) { TestSearchEngine.last = this; } @@ -94,10 +94,7 @@ suite('RawSearchService', () => { test('Individual results', async function () { this.timeout(testTimeout); let i = 5; - const Engine = TestSearchEngine.bind(null, () => { - i--; - return rawMatch; - }); + const Engine = TestSearchEngine.bind(null, () => i-- ? rawMatch : null); const service = new RawSearchService(); let results = 0; @@ -117,10 +114,7 @@ suite('RawSearchService', () => { test('Batch results', async function () { this.timeout(testTimeout); let i = 25; - const Engine = TestSearchEngine.bind(null, () => { - i--; - return rawMatch; - }); + const Engine = TestSearchEngine.bind(null, () => i-- ? rawMatch : null); const service = new RawSearchService(); const results: number[] = []; @@ -143,10 +137,7 @@ suite('RawSearchService', () => { this.timeout(testTimeout); const uriPath = '/some/where'; let i = 25; - const Engine = TestSearchEngine.bind(null, () => { - i--; - return rawMatch; - }); + const Engine = TestSearchEngine.bind(null, () => i-- ? rawMatch : null); const service = new RawSearchService(); function fileSearch(config: IFileQuery, batchSize: number): Event { @@ -271,10 +262,7 @@ suite('RawSearchService', () => { test('Sorted result batches', async function () { this.timeout(testTimeout); let i = 25; - const Engine = TestSearchEngine.bind(null, () => { - i--; - return rawMatch; - }); + const Engine = TestSearchEngine.bind(null, () => i-- ? rawMatch : null); const service = new RawSearchService(); const results: number[] = [];