Skip to content
Permalink
Browse files

test: increase coverage of Buffer.transcode

Adds test for transcoding an empty buffer.

PR-URL: #10437
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
joyeecheung authored and jasnell committed Dec 24, 2016
1 parent e81e031 commit 904b66d870e166192f34083f399499b8e6c9f216
Showing with 5 additions and 0 deletions.
  1. +5 −0 test/parallel/test-icu-transcode.js
@@ -70,3 +70,8 @@ assert.deepStrictEqual(
buffer.transcode(uint8array, 'latin1', 'utf16le'),
Buffer.from('', 'utf16le'));
}

{
const dest = buffer.transcode(new Uint8Array(), 'utf8', 'latin1');
assert.strictEqual(dest.length, 0);
}

0 comments on commit 904b66d

Please sign in to comment.
You can’t perform that action at this time.