debt - test for diagnostics limit
This commit is contained in:
parent
903ee61b39
commit
db65d4aac9
|
@ -8,7 +8,7 @@
|
|||
import * as assert from 'assert';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {DiagnosticCollection} from 'vs/workbench/api/node/extHostDiagnostics';
|
||||
import {Diagnostic, Range, DiagnosticSeverity} from 'vs/workbench/api/node/extHostTypes';
|
||||
import {Diagnostic, Range} from 'vs/workbench/api/node/extHostTypes';
|
||||
import {MainThreadDiagnosticsShape} from 'vs/workbench/api/node/extHost.protocol';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IMarkerData} from 'vs/platform/markers/common/markers';
|
||||
|
@ -159,4 +159,20 @@ suite('ExtHostDiagnostics', () => {
|
|||
});
|
||||
|
||||
|
||||
test('diagnostic capping', function () {
|
||||
|
||||
let lastEntries: [URI, IMarkerData[]][];
|
||||
let collection = new DiagnosticCollection('test', new class extends DiagnosticsShape {
|
||||
$changeMany(owner: string, entries: [URI, IMarkerData[]][]): TPromise<any> {
|
||||
lastEntries = entries;
|
||||
return super.$changeMany(owner, entries);
|
||||
}
|
||||
});
|
||||
let uri = URI.parse('aa:bb');
|
||||
|
||||
collection.set(uri, new Array(500).map((value, i) => new Diagnostic(new Range(i, 0, i + 1, 0), `error#${i}`)));
|
||||
assert.equal(collection.get(uri).length, 500);
|
||||
assert.equal(lastEntries.length, 1);
|
||||
assert.equal(lastEntries[0][1].length, 250);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue