From 904b66d870e166192f34083f399499b8e6c9f216 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds test for transcoding an empty buffer. PR-URL: https://github.com/nodejs/node/pull/10437 Reviewed-By: Rich Trott Reviewed-By: Evan Lucas Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- 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 fc588b220f..8e4176547d 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); +}