Re-enable linkifier unicode tests in Terminal.test.ts
This commit is contained in:
@@ -4,10 +4,9 @@
|
||||
*/
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { IMouseZoneManager, IMouseZone, ILinkMatcher } from 'browser/Types';
|
||||
import { IMouseZoneManager, IMouseZone, IRegisteredLinkMatcher } from 'browser/Types';
|
||||
import { IBufferLine } from 'common/Types';
|
||||
import { Linkifier } from 'browser/Linkifier';
|
||||
// import { TestTerminal } from '../TestUtils.test';
|
||||
import { BufferLine } from 'common/buffer/BufferLine';
|
||||
import { CellData } from 'common/buffer/CellData';
|
||||
import { MockLogService, MockBufferService } from 'common/TestUtils.test';
|
||||
@@ -19,7 +18,7 @@ class TestLinkifier extends Linkifier {
|
||||
Linkifier._timeBeforeLatency = 0;
|
||||
}
|
||||
|
||||
public get linkMatchers(): ILinkMatcher[] { return this._linkMatchers; }
|
||||
public get linkMatchers(): IRegisteredLinkMatcher[] { return this._linkMatchers; }
|
||||
public linkifyRows(): void { super.linkifyRows(0, this._bufferService.buffer.lines.length - 1); }
|
||||
}
|
||||
|
||||
@@ -241,98 +240,4 @@ describe('Linkifier', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
// describe('unicode handling', () => {
|
||||
// let terminal: TestTerminal;
|
||||
|
||||
// // other than the tests above unicode testing needs the full terminal instance
|
||||
// // to get the special handling of fullwidth, surrogate and combining chars in the input handler
|
||||
// beforeEach(() => {
|
||||
// terminal = new TestTerminal({cols: 10, rows: 5});
|
||||
// linkifier = new TestLinkifier(terminal);
|
||||
// mouseZoneManager = new TestMouseZoneManager();
|
||||
// linkifier.attachToDom(undefined as any, mouseZoneManager);
|
||||
// });
|
||||
|
||||
// function assertLinkifiesInTerminal(rowText: string, linkMatcherRegex: RegExp, links: {x1: number, y1: number, x2: number, y2: number}[], done: MochaDone): void {
|
||||
// terminal.writeSync(rowText);
|
||||
// linkifier.registerLinkMatcher(linkMatcherRegex, () => {});
|
||||
// linkifier.linkifyRows();
|
||||
// // Allow linkify to happen
|
||||
// setTimeout(() => {
|
||||
// assert.equal(mouseZoneManager.zones.length, links.length);
|
||||
// links.forEach((l, i) => {
|
||||
// assert.equal(mouseZoneManager.zones[i].x1, l.x1 + 1);
|
||||
// assert.equal(mouseZoneManager.zones[i].x2, l.x2 + 1);
|
||||
// assert.equal(mouseZoneManager.zones[i].y1, l.y1 + 1);
|
||||
// assert.equal(mouseZoneManager.zones[i].y2, l.y2 + 1);
|
||||
// });
|
||||
// done();
|
||||
// }, 0);
|
||||
// }
|
||||
|
||||
// describe('unicode before the match', () => {
|
||||
// it('combining - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('e\u0301e\u0301e\u0301 foo', /foo/, [{x1: 4, x2: 7, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('combining - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('e\u0301e\u0301e\u0301 foo', /foo/, [{x1: 8, x2: 1, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('surrogate - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('𝄞𝄞𝄞 foo', /foo/, [{x1: 4, x2: 7, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('surrogate - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('𝄞𝄞𝄞 foo', /foo/, [{x1: 8, x2: 1, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('combining surrogate - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('𓂀\u0301𓂀\u0301𓂀\u0301 foo', /foo/, [{x1: 4, x2: 7, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('combining surrogate - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('𓂀\u0301𓂀\u0301𓂀\u0301 foo', /foo/, [{x1: 8, x2: 1, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('fullwidth - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('12 foo', /foo/, [{x1: 5, x2: 8, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('fullwidth - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('12 foo', /foo/, [{x1: 8, x2: 1, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('combining fullwidth - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('¥\u0301¥\u0301 foo', /foo/, [{x1: 5, x2: 8, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('combining fullwidth - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('¥\u0301¥\u0301 foo', /foo/, [{x1: 8, x2: 1, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// });
|
||||
// describe('unicode within the match', () => {
|
||||
// it('combining - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('test cafe\u0301', /cafe\u0301/, [{x1: 5, x2: 9, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('combining - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('testtest cafe\u0301', /cafe\u0301/, [{x1: 9, x2: 3, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('surrogate - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('test a𝄞b', /a𝄞b/, [{x1: 5, x2: 8, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('surrogate - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('testtest a𝄞b', /a𝄞b/, [{x1: 9, x2: 2, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('combining surrogate - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('test a𓂀\u0301b', /a𓂀\u0301b/, [{x1: 5, x2: 8, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('combining surrogate - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('testtest a𓂀\u0301b', /a𓂀\u0301b/, [{x1: 9, x2: 2, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('fullwidth - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('test a1b', /a1b/, [{x1: 5, x2: 9, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('fullwidth - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('testtest a1b', /a1b/, [{x1: 9, x2: 3, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// it('combining fullwidth - match within one line', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('test a¥\u0301b', /a¥\u0301b/, [{x1: 5, x2: 9, y1: 0, y2: 0}], done);
|
||||
// });
|
||||
// it('combining fullwidth - match over two lines', function(done: () => void): void {
|
||||
// assertLinkifiesInTerminal('testtest a¥\u0301b', /a¥\u0301b/, [{x1: 9, x2: 3, y1: 0, y2: 1}], done);
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user