summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-29 09:45:31 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-29 09:45:31 (GMT)
commit9f2e46de34b28d20485ef4f1078c544238183537 (patch)
treef4019090a3785a0c1f685200b908e563ac61145c /Lib/test/test_memoryio.py
parent61f56163485f645a0c66780b4746ecf98372f0eb (diff)
parentc92ea76f3f43e367e9bf5fd12713c3b99ffad84a (diff)
downloadcpython-9f2e46de34b28d20485ef4f1078c544238183537.zip
cpython-9f2e46de34b28d20485ef4f1078c544238183537.tar.gz
cpython-9f2e46de34b28d20485ef4f1078c544238183537.tar.bz2
Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
Diffstat (limited to 'Lib/test/test_memoryio.py')
-rw-r--r--Lib/test/test_memoryio.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 4de4f65..d4135d5 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -609,6 +609,15 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin,
UnsupportedOperation = pyio.UnsupportedOperation
EOF = ""
+ def test_lone_surrogates(self):
+ # Issue #20424
+ memio = self.ioclass('\ud800')
+ self.assertEqual(memio.read(), '\ud800')
+
+ memio = self.ioclass()
+ memio.write('\ud800')
+ self.assertEqual(memio.getvalue(), '\ud800')
+
class PyStringIOPickleTest(TextIOTestMixin, unittest.TestCase):
"""Test if pickle restores properly the internal state of StringIO.