diff options
author | Georg Brandl <georg@python.org> | 2007-03-06 19:00:09 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-03-06 19:00:09 (GMT) |
commit | 62b1b001e6798ed178e1c65d26d4e031ca00ff39 (patch) | |
tree | fcf9a4ccc2b90632883b62f04f60bb58003e4585 /Lib | |
parent | 2230d98048be1a20bd177ea72b2124941cd1d9ea (diff) | |
download | cpython-62b1b001e6798ed178e1c65d26d4e031ca00ff39.zip cpython-62b1b001e6798ed178e1c65d26d4e031ca00ff39.tar.gz cpython-62b1b001e6798ed178e1c65d26d4e031ca00ff39.tar.bz2 |
Patch #1654417: make operator.{get,set,del}slice use the full range
of Py_ssize_t.
(backport from rev. 54177)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_operator.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index 3cc0f1e..085f8c4 100644 --- a/Lib/test/test_operator.py +++ b/Lib/test/test_operator.py @@ -143,6 +143,8 @@ class OperatorTestCase(unittest.TestCase): self.failUnlessRaises(TypeError, operator.delslice, a, None, None) self.failUnless(operator.delslice(a, 2, 8) is None) self.assert_(a == [0, 1, 8, 9]) + operator.delslice(a, 0, test_support.MAX_Py_ssize_t) + self.assert_(a == []) def test_div(self): self.failUnlessRaises(TypeError, operator.div, 5) @@ -170,6 +172,8 @@ class OperatorTestCase(unittest.TestCase): self.failUnlessRaises(TypeError, operator.getslice) self.failUnlessRaises(TypeError, operator.getslice, a, None, None) self.failUnless(operator.getslice(a, 4, 6) == [4, 5]) + b = operator.getslice(a, 0, test_support.MAX_Py_ssize_t) + self.assert_(b == a) def test_indexOf(self): self.failUnlessRaises(TypeError, operator.indexOf) @@ -318,6 +322,8 @@ class OperatorTestCase(unittest.TestCase): self.failUnlessRaises(TypeError, operator.setslice, a, None, None, None) self.failUnless(operator.setslice(a, 1, 3, [2, 1]) is None) self.assert_(a == [0, 2, 1, 3]) + operator.setslice(a, 0, test_support.MAX_Py_ssize_t, []) + self.assert_(a == []) def test_sub(self): self.failUnlessRaises(TypeError, operator.sub) |