summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-30 20:51:40 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2007-11-30 20:51:40 (GMT)
commitdafd32b730c246b76a28e4089253e3a2b614df58 (patch)
tree740fe6b260b2daa3de96b66140941337954d5bf3 /Lib
parentbe49a90eb3c54bd29a8bf3da5875db26d2fa2924 (diff)
downloadcpython-dafd32b730c246b76a28e4089253e3a2b614df58.zip
cpython-dafd32b730c246b76a28e4089253e3a2b614df58.tar.gz
cpython-dafd32b730c246b76a28e4089253e3a2b614df58.tar.bz2
Issue #1521: on 64bit platforms, str.decode fails on very long strings.
The t# and w# formats were not correctly handled. Will backport.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_bigmem.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_bigmem.py b/Lib/test/test_bigmem.py
index 6d6c37c..d4fc6eb 100644
--- a/Lib/test/test_bigmem.py
+++ b/Lib/test/test_bigmem.py
@@ -65,13 +65,15 @@ class StrTest(unittest.TestCase):
self.assertEquals(s.count('i'), 1)
self.assertEquals(s.count('j'), 0)
- @bigmemtest(minsize=0, memuse=1)
+ @bigmemtest(minsize=_2G + 2, memuse=3)
def test_decode(self, size):
- pass
+ s = '.' * size
+ self.assertEquals(len(s.decode('utf-8')), size)
- @bigmemtest(minsize=0, memuse=1)
+ @bigmemtest(minsize=_2G + 2, memuse=3)
def test_encode(self, size):
- pass
+ s = u'.' * size
+ self.assertEquals(len(s.encode('utf-8')), size)
@bigmemtest(minsize=_2G, memuse=2)
def test_endswith(self, size):