Skip to content

Commit 48f8869

Browse files
sushi90targos
authored andcommitted
test: add coverage for utf8CheckIncomplete()
This commit adds code coverage to utf8CheckIncomplete(), when the lastNeed is greater than buffer length. PR-URL: #11419 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent a1c652a commit 48f8869

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/parallel/test-string-decoder.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ assert.strictEqual(decoder.write(Buffer.from('F1', 'hex')), '');
8383
assert.strictEqual(decoder.write(Buffer.from('41F2', 'hex')), '\ufffdA');
8484
assert.strictEqual(decoder.end(), '\ufffd');
8585

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

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

0 commit comments

Comments
 (0)