summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_strop.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-03-31 00:09:44 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-03-31 00:09:44 (GMT)
commitd42f60ed816a53f79ee479af8191aaa795095386 (patch)
treef12c679f9c0153288ceb463b8d4613e658f0c53e /Lib/test/test_strop.py
parent18fc4934097b193f54290085c93cd165352216bb (diff)
downloadcpython-d42f60ed816a53f79ee479af8191aaa795095386.zip
cpython-d42f60ed816a53f79ee479af8191aaa795095386.tar.gz
cpython-d42f60ed816a53f79ee479af8191aaa795095386.tar.bz2
fix overflow detection of strop.expandtabs
Diffstat (limited to 'Lib/test/test_strop.py')
-rw-r--r--Lib/test/test_strop.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py
index 8ce29ef..45c90a6 100644
--- a/Lib/test/test_strop.py
+++ b/Lib/test/test_strop.py
@@ -4,6 +4,7 @@ warnings.filterwarnings("ignore", "strop functions are obsolete;",
r'test.test_strop|unittest')
import strop
import unittest
+import sys
from test import test_support
@@ -115,6 +116,11 @@ class StropFunctionTestCase(unittest.TestCase):
strop.uppercase
strop.whitespace
+ @unittest.skipUnless(sys.maxsize == 2147483647, "only for 32-bit")
+ def test_expandtabs_overflow(self):
+ s = '\t\n' * 0x10000 + 'A' * 0x1000000
+ self.assertRaises(OverflowError, strop.expandtabs, s, 0x10001)
+
@test_support.precisionbigmemtest(size=test_support._2G - 1, memuse=5)
def test_stropjoin_huge_list(self, size):
a = "A" * size