Skip to content

Commit dc31427

Browse files
authored
Add a new unit test to ensure incremental decoding works
1 parent c077eed commit dc31427

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/runners.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,16 @@ def writes_and_flushes_to_stderr(self):
539539
err.write.assert_called_once_with("whatever")
540540
err.flush.assert_called_once_with()
541541

542+
def handles_incremental_decoding(self):
543+
# 𠜎 is 4 bytes in utf-8
544+
expected_out = "𠜎" * 50
545+
runner = self._runner(out=expected_out)
546+
# Make sure every read returns a partial character.
547+
runner.read_chunk_size = 3
548+
out = StringIO()
549+
runner.run(_, out_stream=out)
550+
assert out.getvalue() == expected_out
551+
542552
class input_stream_handling:
543553
# NOTE: actual autoresponder tests are elsewhere. These just test that
544554
# stdin works normally & can be overridden.

0 commit comments

Comments
 (0)