diff --git a/test/base64.js b/test/base64.js index 5e25a7e..ca724a6 100644 --- a/test/base64.js +++ b/test/base64.js @@ -12,6 +12,10 @@ var atob = base64.atob; describe ('Base64.js', function() { it ('can encode ASCII input', function() { + for (let i = 0; i < 255; i++) { + const char = String.fromCharCode(i); + assert.strictEqual (btoa (char), btoa(char)); + } assert.strictEqual (btoa (''), ''); assert.strictEqual (btoa ('f'), 'Zg=='); assert.strictEqual (btoa ('fo'), 'Zm8='); @@ -49,6 +53,10 @@ describe ('Base64.js', function() { }); it ('can decode Base64-encoded input', function() { + for (let i = 0; i < 255; i++) { + const char = String.fromCharCode(i); + assert.strictEqual (atob(btoa (char)), char); + } assert.strictEqual (atob (''), ''); assert.strictEqual (atob ('Zg=='), 'f'); assert.strictEqual (atob ('Zm8='), 'fo');