summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-12-27 07:16:40 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-12-27 07:16:40 (GMT)
commit966322f9291786f3456fe24f9d5c767e92eba1d0 (patch)
tree251600e1a9c6e0c69a52833d27e333625baa2d4f /Lib/test
parent6a00c74211c555b48faf17f5da9baca4ba2eb468 (diff)
downloadcpython-966322f9291786f3456fe24f9d5c767e92eba1d0.zip
cpython-966322f9291786f3456fe24f9d5c767e92eba1d0.tar.gz
cpython-966322f9291786f3456fe24f9d5c767e92eba1d0.tar.bz2
Merged revisions 67934-67935 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67934 | alexandre.vassalotti | 2008-12-27 02:08:47 -0500 (Sat, 27 Dec 2008) | 4 lines Fix issue #4730: cPickle corrupts high-unicode strings. Update outdated copy of PyUnicode_EncodeRawUnicodeEscape. Add a test case. ........ r67935 | alexandre.vassalotti | 2008-12-27 02:13:01 -0500 (Sat, 27 Dec 2008) | 2 lines Add Misc/NEWS entry for r67934. ........
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/pickletester.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index bf9bca7..bf25245 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -480,14 +480,21 @@ class AbstractPickleTests(unittest.TestCase):
if have_unicode:
def test_unicode(self):
- endcases = [unicode(''), unicode('<\\u>'), unicode('<\\\u1234>'),
- unicode('<\n>'), unicode('<\\>')]
+ endcases = [u'', u'<\\u>', u'<\\\\u1234>', u'<\n>',
+ u'<\\>', u'<\\\\U00012345>']
for proto in protocols:
for u in endcases:
p = self.dumps(u, proto)
u2 = self.loads(p)
self.assertEqual(u2, u)
+ def test_unicode_high_plane(self):
+ t = u'\U00012345'
+ for proto in protocols:
+ p = self.dumps(t, proto)
+ t2 = self.loads(p)
+ self.assertEqual(t2, t)
+
def test_ints(self):
import sys
for proto in protocols: