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 <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>
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

Lines changed: 5 additions & 0 deletions
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)