mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
test: increase coverage of Buffer.transcode
Adds test for transcoding an empty buffer. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
e81e031af7
commit
904b66d870
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user