Skip to content

Commit 904b66d

Browse files
joyeecheungjasnell
authored andcommitted
test: increase coverage of Buffer.transcode
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]>
1 parent e81e031 commit 904b66d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/parallel/test-icu-transcode.js

+5
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,8 @@ assert.deepStrictEqual(
7070
buffer.transcode(uint8array, 'latin1', 'utf16le'),
7171
Buffer.from('hä', 'utf16le'));
7272
}
73+
74+
{
75+
const dest = buffer.transcode(new Uint8Array(), 'utf8', 'latin1');
76+
assert.strictEqual(dest.length, 0);
77+
}

0 commit comments

Comments
 (0)