summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorJack Diederich <jackdied@gmail.com>2006-09-21 17:50:26 (GMT)
committerJack Diederich <jackdied@gmail.com>2006-09-21 17:50:26 (GMT)
commit36234e8f6632673ed13658798307ff487d7a7f6a (patch)
tree2007dc234dcffac649f77a41d6ea35fa2b503940 /Lib/test/test_itertools.py
parentd14bf61d0528d040183ba9ae7f6b8b4e340818ef (diff)
downloadcpython-36234e8f6632673ed13658798307ff487d7a7f6a.zip
cpython-36234e8f6632673ed13658798307ff487d7a7f6a.tar.gz
cpython-36234e8f6632673ed13658798307ff487d7a7f6a.tar.bz2
* regression bug, count_next was coercing a Py_ssize_t to an unsigned Py_size_t
which breaks negative counts * added test for negative numbers will backport to 2.5.1
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 6898725..2baa507 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -58,6 +58,10 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(repr(c), 'count(3)')
c.next()
self.assertEqual(repr(c), 'count(4)')
+ c = count(-9)
+ self.assertEqual(repr(c), 'count(-9)')
+ c.next()
+ self.assertEqual(c.next(), -8)
def test_cycle(self):
self.assertEqual(take(10, cycle('abc')), list('abcabcabca'))