From 8dd90e359908c299128163d408d4cc2e630d1b0f Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 25 Dec 2016 01:27:23 +0800 Subject: [PATCH] test: increase coverage of Buffer.transcode Adds test for transcoding an empty buffer. --- test/parallel/test-icu-transcode.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/parallel/test-icu-transcode.js b/test/parallel/test-icu-transcode.js index fc588b220f5366..8e4176547df741 100644 --- a/test/parallel/test-icu-transcode.js +++ b/test/parallel/test-icu-transcode.js @@ -70,3 +70,8 @@ assert.deepStrictEqual( buffer.transcode(uint8array, 'latin1', 'utf16le'), Buffer.from('hä', 'utf16le')); } + +{ + const dest = buffer.transcode(new Uint8Array(), 'utf8', 'latin1'); + assert.strictEqual(dest.length, 0); +}