From: daverayment Date: Tue, 4 Aug 2015 10:00:45 +0000 (+0100) Subject: Test for updated base 64 regex X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=30c4e22691e690aa60f839d9091ad28a62e8b22a;p=buffer.git Test for updated base 64 regex Confirm that non-base 64 alphabet characters are correctly stripped out. --- diff --git a/test/base64.js b/test/base64.js index 9772de4..12c4c78 100644 --- a/test/base64.js +++ b/test/base64.js @@ -37,3 +37,11 @@ test('base64: tab characters in base64 - should get stripped', function (t) { ) t.end() }) + +test('base64: invalid non-alphanumeric characters -- should be stripped', function (t) { + t.equal( + new B('!"#$%&\'()*,.:;<=>?@[\\]^`{|}~', 'base64').toString('utf8'), + '' + ) + t.end() +})