diff options
author | Georg Brandl <georg@python.org> | 2007-03-06 18:59:11 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-03-06 18:59:11 (GMT) |
commit | 40c626159d8da4b241980deb1f356b62a101bd51 (patch) | |
tree | 5affa11622b32422d6d8215fd2ded62329ae7d9e /Lib/test/test_operator.py | |
parent | 667eb7c8536661f1b4648ed5c2d1155b585a3b01 (diff) | |
download | cpython-40c626159d8da4b241980deb1f356b62a101bd51.zip cpython-40c626159d8da4b241980deb1f356b62a101bd51.tar.gz cpython-40c626159d8da4b241980deb1f356b62a101bd51.tar.bz2 |
Patch #1654417: make operator.{get,set,del}slice use the full range
of Py_ssize_t.
Diffstat (limited to 'Lib/test/test_operator.py')
-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) |