From 30c4e22691e690aa60f839d9091ad28a62e8b22a Mon Sep 17 00:00:00 2001 From: daverayment Date: Tue, 4 Aug 2015 11:00:45 +0100 Subject: [PATCH] Test for updated base 64 regex Confirm that non-base 64 alphabet characters are correctly stripped out. --- test/base64.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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() +}) -- 2.34.1