Merge pull request #5983 from xtermjs/cursor/test-fixes-explore-e565
test: search, parser title, and attach suite fixes
This commit is contained in:
@@ -15,7 +15,7 @@ test.beforeAll(async ({ browser }) => {
|
|||||||
});
|
});
|
||||||
test.afterAll(async () => await ctx.page.close());
|
test.afterAll(async () => await ctx.page.close());
|
||||||
|
|
||||||
test.describe('Search Tests', () => {
|
test.describe('AttachAddon', () => {
|
||||||
|
|
||||||
test.beforeEach(async () => {
|
test.beforeEach(async () => {
|
||||||
await ctx.proxy.reset();
|
await ctx.proxy.reset();
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ test.describe('Search Tests', () => {
|
|||||||
test.describe('#2444 wrapped line content not being found', () => {
|
test.describe('#2444 wrapped line content not being found', () => {
|
||||||
let fixture: string;
|
let fixture: string;
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
fixture = (await new Promise<Buffer>(r => readFile(resolve(__dirname, '../fixtures/issue-2444'), (err, data) => r(data)))).toString();
|
fixture = (await new Promise<Buffer>((res, rej) => readFile(resolve(__dirname, '../fixtures/issue-2444'), (err, data) => err ? rej(err) : res(data)))).toString();
|
||||||
if (process.platform !== 'win32') {
|
if (process.platform !== 'win32') {
|
||||||
fixture = fixture.replace(/\n/g, '\n\r');
|
fixture = fixture.replace(/\n/g, '\n\r');
|
||||||
}
|
}
|
||||||
@@ -501,7 +501,7 @@ test.describe('Search Tests', () => {
|
|||||||
window.search.onDidChangeResults(e => window.calls.push(e));
|
window.search.onDidChangeResults(e => window.calls.push(e));
|
||||||
`);
|
`);
|
||||||
// Move cursor forward 1 time to create a null character, as opposed to regular whitespace
|
// Move cursor forward 1 time to create a null character, as opposed to regular whitespace
|
||||||
await ctx.proxy.write('\\x1b[CHi Hi');
|
await ctx.proxy.write('\x1b[CHi Hi');
|
||||||
strictEqual(await ctx.page.evaluate(`window.search.findPrevious('h', { decorations: { activeMatchColorOverviewRuler: '#ff0000' } })`), true);
|
strictEqual(await ctx.page.evaluate(`window.search.findPrevious('h', { decorations: { activeMatchColorOverviewRuler: '#ff0000' } })`), true);
|
||||||
deepStrictEqual(await ctx.page.evaluate('window.calls'), [
|
deepStrictEqual(await ctx.page.evaluate('window.calls'), [
|
||||||
{ resultCount: 2, resultIndex: 1 }
|
{ resultCount: 2, resultIndex: 1 }
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ test.describe('SerializeAddon', () => {
|
|||||||
const cols = 10;
|
const cols = 10;
|
||||||
const line = '+'.repeat(cols);
|
const line = '+'.repeat(cols);
|
||||||
const lines: string[] = [
|
const lines: string[] = [
|
||||||
sgr(FG_P16_GREEN) + line, // Workaround: If we clear all flags a the end, serialize will use \x1b[0m to clear instead of the sepcific disable sequence
|
sgr(FG_P16_GREEN) + line, // Workaround: If we clear all flags at the end, serialize will use \x1b[0m to clear instead of the specific disable sequence
|
||||||
sgr(INVERSE) + line,
|
sgr(INVERSE) + line,
|
||||||
sgr(BOLD) + line,
|
sgr(BOLD) + line,
|
||||||
sgr(UNDERLINED) + line,
|
sgr(UNDERLINED) + line,
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ describe('MouseService _triggerMouseEvent', () => {
|
|||||||
for (let i = 0; i < bufferService.cols; ++i) {
|
for (let i = 0; i < bufferService.cols; ++i) {
|
||||||
assert.equal(trigger({ col: i, row: 0, x: 0, y: 0, button: CoreMouseButton.LEFT, action: CoreMouseAction.DOWN }), true);
|
assert.equal(trigger({ col: i, row: 0, x: 0, y: 0, button: CoreMouseButton.LEFT, action: CoreMouseAction.DOWN }), true);
|
||||||
if (i > 222) {
|
if (i > 222) {
|
||||||
// supress mouse reports if we are out of addressible range (max. 222)
|
// suppress mouse reports if we are out of addressable range (max. 222)
|
||||||
assert.deepEqual(toBytes(reports.pop()), []);
|
assert.deepEqual(toBytes(reports.pop()), []);
|
||||||
} else {
|
} else {
|
||||||
assert.deepEqual(toBytes(reports.pop()), [0x1b, 0x5b, 0x4d, 0x20, i + 33, 0x21]);
|
assert.deepEqual(toBytes(reports.pop()), [0x1b, 0x5b, 0x4d, 0x20, i + 33, 0x21]);
|
||||||
|
|||||||
@@ -1241,7 +1241,7 @@ describe('InputHandler', () => {
|
|||||||
await inputHandler.parseP('\x1b[e');
|
await inputHandler.parseP('\x1b[e');
|
||||||
assert.deepEqual(getCursor(bufferService), [8, 5]);
|
assert.deepEqual(getCursor(bufferService), [8, 5]);
|
||||||
});
|
});
|
||||||
describe('should clamp cursor into addressible range', () => {
|
describe('should clamp cursor into addressable range', () => {
|
||||||
it('CUF', async () => {
|
it('CUF', async () => {
|
||||||
bufferService.buffer.x = 10000;
|
bufferService.buffer.x = 10000;
|
||||||
bufferService.buffer.y = 10000;
|
bufferService.buffer.y = 10000;
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ describe('EscapeSequenceParser', () => {
|
|||||||
p = new TestEscapeSequenceParser(tansitions);
|
p = new TestEscapeSequenceParser(tansitions);
|
||||||
assert.deepEqual(p.transitions, tansitions);
|
assert.deepEqual(p.transitions, tansitions);
|
||||||
});
|
});
|
||||||
it('inital states', () => {
|
it('initial states', () => {
|
||||||
assert.equal(parser.initialState, ParserState.GROUND);
|
assert.equal(parser.initialState, ParserState.GROUND);
|
||||||
assert.equal(parser.currentState, ParserState.GROUND);
|
assert.equal(parser.currentState, ParserState.GROUND);
|
||||||
assert.equal(parser.osc, '');
|
assert.equal(parser.osc, '');
|
||||||
|
|||||||
@@ -980,7 +980,7 @@ export function injectSharedRendererTests(ctx: ISharedRendererTestContext): void
|
|||||||
});
|
});
|
||||||
|
|
||||||
test.describe('selectionInactiveBackground', async () => {
|
test.describe('selectionInactiveBackground', async () => {
|
||||||
test('should render the the inactive selection when not focused', async () => {
|
test('should render the inactive selection when not focused', async () => {
|
||||||
const theme: ITheme = {
|
const theme: ITheme = {
|
||||||
selectionBackground: '#FF000080',
|
selectionBackground: '#FF000080',
|
||||||
selectionInactiveBackground: '#0000FF80'
|
selectionInactiveBackground: '#0000FF80'
|
||||||
|
|||||||
Reference in New Issue
Block a user