summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-10-15 15:47:36 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-10-15 15:47:36 (GMT)
commite1bd38c03c16cd27227b3148d2be0ef1ab678448 (patch)
tree6ca661c659881b0785ed35ed82bdb9e1d07c6831 /Lib/test/test_unicode.py
parent77a75b3db1b3c63833067f6864e62dcf312ded05 (diff)
downloadcpython-e1bd38c03c16cd27227b3148d2be0ef1ab678448.zip
cpython-e1bd38c03c16cd27227b3148d2be0ef1ab678448.tar.gz
cpython-e1bd38c03c16cd27227b3148d2be0ef1ab678448.tar.bz2
fix integer overflow in unicode case operations (closes #22643)
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index c2ede07..e1ccd5c 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -661,6 +661,11 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual('x'.center(4, '\U0010FFFF'),
'\U0010FFFFx\U0010FFFF\U0010FFFF')
+ @unittest.skipUnless(sys.maxsize == 2**31 - 1, "requires 32-bit system")
+ def test_case_operation_overflow(self):
+ # Issue #22643
+ self.assertRaises(OverflowError, ("ΓΌ"*(2**32//12 + 1)).upper)
+
def test_contains(self):
# Testing Unicode contains method
self.assertIn('a', 'abdb')