summaryrefslogtreecommitdiff
path: root/tests/test_unicode.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_unicode.py')
-rw-r--r--tests/test_unicode.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_unicode.py b/tests/test_unicode.py
index 483a956..c4bc394 100644
--- a/tests/test_unicode.py
+++ b/tests/test_unicode.py
@@ -123,6 +123,18 @@ class UnicodeTests(PexpectTestCase.PexpectTestCase):
p.sendeof()
p.expect(pexpect.EOF)
+ def test_spawn_utf8_incomplete(self):
+ # This test case ensures correct incremental decoding, as the first
+ # beta release decoded bytes staticly:
+ # return codecs.utf_8_decode(input, errors, True)
+ # which fails when the stream read does not align exactly at a utf-8
+ # multibyte boundry:
+ # UnicodeDecodeError: 'utf8' codec can't decode byte 0xe2 in
+ # position 0: unexpected end of data
+ p = pexpect.spawnu('./utf8-err.py')
+ p.expect(u'▁▂▃▄▅▆▇█')
+
+
if __name__ == '__main__':
unittest.main()