Skip to content

Commit

Permalink
test: increase coverage of Buffer.transcode
Browse files Browse the repository at this point in the history
Adds test for transcoding an empty buffer.

PR-URL: #10437
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
joyeecheung authored and jasnell committed Dec 24, 2016
1 parent e81e031 commit 904b66d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-icu-transcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 904b66d

Please sign in to comment.