From: Guido van Rossum Date: Mon, 12 Nov 2007 20:06:40 +0000 (+0000) Subject: Add the test from issue 1704621 (the issue itself is already fixed here). X-Git-Tag: v2.6a1~1060 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0288cb0ba8f98119e0badad583e43e2ae7778877;p=python Add the test from issue 1704621 (the issue itself is already fixed here). --- diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py index 18fb3b786d..df29a33665 100644 --- a/Lib/test/seq_tests.py +++ b/Lib/test/seq_tests.py @@ -306,6 +306,13 @@ class CommonTest(unittest.TestCase): self.assertEqual(self.type2test(s)*(-4), self.type2test([])) self.assertEqual(id(s), id(s*1)) + def test_bigrepeat(self): + x = self.type2test([0]) + x *= 2**16 + self.assertRaises(MemoryError, x.__mul__, 2**16) + if hasattr(x, '__imul__'): + self.assertRaises(MemoryError, x.__imul__, 2**16) + def test_subscript(self): a = self.type2test([10, 11]) self.assertEqual(a.__getitem__(0L), 10)