Commit 47cb38cd authored by Serhiy Storchaka's avatar Serhiy Storchaka

Backported a test for lone surrogates support in io.StringIO.

parent 16252724
......@@ -588,6 +588,16 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin,
UnsupportedOperation = pyio.UnsupportedOperation
EOF = ""
def test_lone_surrogates(self):
# Issue #20424
surrogate = unichr(0xd800)
memio = self.ioclass(surrogate)
self.assertEqual(memio.read(), surrogate)
memio = self.ioclass()
memio.write(surrogate)
self.assertEqual(memio.getvalue(), surrogate)
class PyStringIOPickleTest(TextIOTestMixin, unittest.TestCase):
"""Test if pickle restores properly the internal state of StringIO.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment