mirror of https://github.com/tc39/test262.git
add test for excess padding
This commit is contained in:
parent
070d7ee87e
commit
44803f799c
|
@ -37,7 +37,7 @@ assert.throws(SyntaxError, function() {
|
|||
Uint8Array.fromBase64('ZXhhZh', { lastChunkHandling: 'strict' });
|
||||
});
|
||||
|
||||
// malformed padding
|
||||
// partial padding
|
||||
assert.throws(SyntaxError, function() {
|
||||
Uint8Array.fromBase64('ZXhhZg=');
|
||||
});
|
||||
|
@ -48,3 +48,17 @@ assert.compareArray(Uint8Array.fromBase64('ZXhhZg=', { lastChunkHandling: 'stop-
|
|||
assert.throws(SyntaxError, function() {
|
||||
Uint8Array.fromBase64('ZXhhZg=', { lastChunkHandling: 'strict' });
|
||||
});
|
||||
|
||||
// excess padding
|
||||
assert.throws(SyntaxError, function() {
|
||||
Uint8Array.fromBase64('ZXhhZg===');
|
||||
});
|
||||
assert.throws(SyntaxError, function() {
|
||||
Uint8Array.fromBase64('ZXhhZg===', { lastChunkHandling: 'loose' });
|
||||
});
|
||||
assert.throws(SyntaxError, function() {
|
||||
Uint8Array.fromBase64('ZXhhZg===', { lastChunkHandling: 'stop-before-partial' });
|
||||
});
|
||||
assert.throws(SyntaxError, function() {
|
||||
Uint8Array.fromBase64('ZXhhZg===', { lastChunkHandling: 'strict' });
|
||||
});
|
||||
|
|
|
@ -108,7 +108,7 @@ assert.throws(SyntaxError, function() {
|
|||
});
|
||||
|
||||
|
||||
// malformed padding
|
||||
// partial padding
|
||||
assert.throws(SyntaxError, function() {
|
||||
var target = new Uint8Array([255, 255, 255, 255, 255, 255]);
|
||||
target.setFromBase64('ZXhhZg=');
|
||||
|
@ -129,3 +129,25 @@ assert.throws(SyntaxError, function() {
|
|||
var target = new Uint8Array([255, 255, 255, 255, 255, 255]);
|
||||
target.setFromBase64('ZXhhZg=', { lastChunkHandling: 'strict' });
|
||||
});
|
||||
|
||||
|
||||
// excess padding
|
||||
assert.throws(SyntaxError, function() {
|
||||
var target = new Uint8Array([255, 255, 255, 255, 255, 255]);
|
||||
target.setFromBase64('ZXhhZg===');
|
||||
});
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
var target = new Uint8Array([255, 255, 255, 255, 255, 255]);
|
||||
target.setFromBase64('ZXhhZg===', { lastChunkHandling: 'loose' });
|
||||
});
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
var target = new Uint8Array([255, 255, 255, 255, 255, 255]);
|
||||
target.setFromBase64('ZXhhZg===', { lastChunkHandling: 'stop-before-partial' });
|
||||
});
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
var target = new Uint8Array([255, 255, 255, 255, 255, 255]);
|
||||
target.setFromBase64('ZXhhZg===', { lastChunkHandling: 'strict' });
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue