Skip to content

Commit

Permalink
Add background true color tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Nov 10, 2019
1 parent 350ca8d commit 787cbbf
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions addons/xterm-addon-webgl/src/WebglRenderer.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,24 @@ describe.only('WebGL Renderer Integration Tests', function(): void {
}
});

it('background true color red', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
data += `\\x1b[48;2;${i};0;0m \x1b[0m`;
}
data += '\\r\\n';
}
await writeSync(data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
await pollFor(page, () => getCellColor(x + 1, y + 1), [i, 0, 0, 255]);
}
}
});

it('foreground true color green', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
Expand All @@ -198,6 +216,24 @@ describe.only('WebGL Renderer Integration Tests', function(): void {
}
});

it('background true color green', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
data += `\\x1b[48;2;0;${i};0m \x1b[0m`;
}
data += '\\r\\n';
}
await writeSync(data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
await pollFor(page, () => getCellColor(x + 1, y + 1), [0, i, 0, 255]);
}
}
});

it('foreground true color blue', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
Expand All @@ -216,6 +252,24 @@ describe.only('WebGL Renderer Integration Tests', function(): void {
}
});

it('background true color blue', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
data += `\\x1b[48;2;0;0;${i}m \x1b[0m`;
}
data += '\\r\\n';
}
await writeSync(data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
await pollFor(page, () => getCellColor(x + 1, y + 1), [0, 0, i, 255]);
}
}
});

it('foreground true color grey', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
Expand All @@ -233,6 +287,24 @@ describe.only('WebGL Renderer Integration Tests', function(): void {
}
}
});

it('background true color grey', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
data += `\\x1b[48;2;${i};${i};${i}m \x1b[0m`;
}
data += '\\r\\n';
}
await writeSync(data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
await pollFor(page, () => getCellColor(x + 1, y + 1), [i, i, i, 255]);
}
}
});
});
});

Expand Down

0 comments on commit 787cbbf

Please sign in to comment.