Skip to content

Commit b457f38

Browse files
sushi90addaleax
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 0240eb9 commit b457f38

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/parallel/test-string-decoder.js

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ assert.strictEqual(decoder.write(Buffer.from('F1', 'hex')), '');
8787
assert.strictEqual(decoder.write(Buffer.from('41F2', 'hex')), '\ufffdA');
8888
assert.strictEqual(decoder.end(), '\ufffd');
8989

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

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

0 commit comments

Comments
 (0)