]> zoso.dev Git - buffer.git/commitdiff
Test for updated base 64 regex
authordaverayment <dave.rayment@gmail.com>
Tue, 4 Aug 2015 10:00:45 +0000 (11:00 +0100)
committerdaverayment <dave.rayment@gmail.com>
Tue, 4 Aug 2015 10:00:45 +0000 (11:00 +0100)
Confirm that non-base 64 alphabet characters are correctly stripped out.

test/base64.js

index 9772de400eddbe4c145431718d92407b1a0fbae1..12c4c780c963fbf15ecadb513240ddf633edaf44 100644 (file)
@@ -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()
+})