Skip to content

Commit

Permalink
test: add coverage for utf8CheckIncomplete()
Browse files Browse the repository at this point in the history
This commit adds code coverage to utf8CheckIncomplete(), when the
lastNeed is greater than buffer length.

PR-URL: #11419
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
sushi90 authored and jasnell committed Mar 7, 2017
1 parent 253f289 commit cb9b7bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-string-decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ assert.strictEqual(decoder.write(Buffer.from('F1', 'hex')), '');
assert.strictEqual(decoder.write(Buffer.from('41F2', 'hex')), '\ufffdA');
assert.strictEqual(decoder.end(), '\ufffd');

// Additional utf8Text test
decoder = new StringDecoder('utf8');
assert.strictEqual(decoder.text(Buffer.from([0x41]), 2), '');

// Additional UTF-16LE surrogate pair tests
decoder = new StringDecoder('utf16le');
Expand Down

0 comments on commit cb9b7bf

Please sign in to comment.