mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Add the test from issue 1704621 (the issue itself is already fixed here).
This commit is contained in:
parent
1bc4af4bdd
commit
0288cb0ba8
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue