diff options
author | Guido van Rossum <guido@python.org> | 2007-11-12 20:06:40 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-11-12 20:06:40 +0000 |
commit | 84f6f7495fe1f5a64623aed04c0fb3419b26dbeb (patch) | |
tree | b9669a30929016f5b738f6d29680ffc0d04f241e /Lib | |
parent | fcd064bb47c681f9d2fdb5311e0155ba1d3cdae8 (diff) | |
download | cpython-84f6f7495fe1f5a64623aed04c0fb3419b26dbeb.tar.gz |
Add the test from issue 1704621 (the issue itself is already fixed here).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/seq_tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
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) |