basic marker test cases

This commit is contained in:
Jörg Breitbart
2020-10-03 16:32:46 +02:00
parent f5a4eed27c
commit 9b62d8a01a
2 changed files with 79 additions and 0 deletions
+14
View File
@@ -1085,6 +1085,20 @@ describe('Buffer', () => {
assert.equal(marker.isDisposed, true);
assert.equal(buffer.markers.length, 0);
});
it('should call onDispose', () => {
const eventStack: string[] = [];
buffer = new Buffer(true, new MockOptionsService({ scrollback: 0 }), bufferService);
buffer.fillViewportRows();
assert.equal(buffer.markers.length, 0);
const marker = buffer.addMarker(0);
marker.onDispose(() => eventStack.push('disposed'));
assert.equal(marker.isDisposed, false);
assert.equal(buffer.markers.length, 1);
buffer.lines.onTrimEmitter.fire(1);
assert.equal(marker.isDisposed, true);
assert.equal(buffer.markers.length, 0);
assert.deepEqual(eventStack, ['disposed']);
});
});
describe ('translateBufferLineToString', () => {