Browse Source

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>
v6
Joyee Cheung 8 years ago
committed by James M Snell
parent
commit
904b66d870
  1. 5
      test/parallel/test-icu-transcode.js

5
test/parallel/test-icu-transcode.js

@ -70,3 +70,8 @@ assert.deepStrictEqual(
buffer.transcode(uint8array, 'latin1', 'utf16le'), buffer.transcode(uint8array, 'latin1', 'utf16le'),
Buffer.from('hä', 'utf16le')); Buffer.from('hä', 'utf16le'));
} }
{
const dest = buffer.transcode(new Uint8Array(), 'utf8', 'latin1');
assert.strictEqual(dest.length, 0);
}

Loading…
Cancel
Save