mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
A test case for the fix in #1674228.
This commit is contained in:
parent
3eb7648986
commit
3071a1aec9
1 changed files with 11 additions and 0 deletions
|
@ -92,6 +92,17 @@ class SliceTest(unittest.TestCase):
|
||||||
|
|
||||||
self.assertRaises(OverflowError, slice(None).indices, 1L<<100)
|
self.assertRaises(OverflowError, slice(None).indices, 1L<<100)
|
||||||
|
|
||||||
|
def test_setslice_without_getslice(self):
|
||||||
|
tmp = []
|
||||||
|
class X(object):
|
||||||
|
def __setslice__(self, i, j, k):
|
||||||
|
tmp.append((i, j, k))
|
||||||
|
|
||||||
|
x = X()
|
||||||
|
x[1:2] = 42
|
||||||
|
self.assertEquals(tmp, [(1, 2, 42)])
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
test_support.run_unittest(SliceTest)
|
test_support.run_unittest(SliceTest)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue