Skip to content

Commit

Permalink
Split up Base64Decoder decoding tests
Browse files Browse the repository at this point in the history
Fixes #4696
  • Loading branch information
Tyriar committed Aug 19, 2023
1 parent 9057072 commit 1c5596d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
33 changes: 15 additions & 18 deletions addons/xterm-addon-image/src/base64.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ describe('Base64Decoder', () => {
assert.deepEqual(dec.data8, inp);
}
});
it('1+2 bytes', function() {
this.timeout(20000);
const dec = new Base64Decoder(0);
for (let a = 0; a < 256; ++a) {
for (let a = 0; a < 256; ++a) {
it(`1+2 bytes (${a})`, function() {
const dec = new Base64Decoder(0);
for (let b = 0; b < 256; ++b) {
dec.init(2);
const inp = new Uint8Array([a, b]);
Expand All @@ -57,12 +56,11 @@ describe('Base64Decoder', () => {
assert.strictEqual(dec.end(), 0);
assert.deepEqual(dec.data8, inp);
}
}
});
it('2+3 bytes', function() {
this.timeout(20000);
const dec = new Base64Decoder(0);
for (let a = 0; a < 256; ++a) {
});
}
for (let a = 0; a < 256; ++a) {
it(`2+3 bytes (${a})`, function() {
const dec = new Base64Decoder(0);
for (let b = 0; b < 256; ++b) {
dec.init(3);
const inp = new Uint8Array([0, a, b]);
Expand All @@ -71,12 +69,11 @@ describe('Base64Decoder', () => {
assert.strictEqual(dec.end(), 0);
assert.deepEqual(dec.data8, inp);
}
}
});
it('3+4 bytes', function() {
this.timeout(20000);
const dec = new Base64Decoder(0);
for (let a = 0; a < 256; ++a) {
});
}
for (let a = 0; a < 256; ++a) {
it(`3+4 bytes (${a})`, function() {
const dec = new Base64Decoder(0);
for (let b = 0; b < 256; ++b) {
dec.init(4);
const inp = new Uint8Array([0, 0, a, b]);
Expand All @@ -85,8 +82,8 @@ describe('Base64Decoder', () => {
assert.strictEqual(dec.end(), 0);
assert.deepEqual(dec.data8, inp);
}
}
});
});
}
it('padding', () => {
const dec = new Base64Decoder(0);
const d = fromBs('Hello, here comes the mouse');
Expand Down
2 changes: 1 addition & 1 deletion src/common/input/TextDecoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('text encodings', () => {
assert.equal(utf32ToString(data), s);
});

describe.only('StringToUtf32 decoder', () => {
describe('StringToUtf32 decoder', () => {
describe('full codepoint test', () => {
for (let min = 0; min < 65535; min += BATCH_SIZE) {
const max = Math.min(min + BATCH_SIZE, 65536);
Expand Down

0 comments on commit 1c5596d

Please sign in to comment.