summaryrefslogtreecommitdiff
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorJack Diederich <jackdied@gmail.com>2006-09-21 18:32:11 +0000
committerJack Diederich <jackdied@gmail.com>2006-09-21 18:32:11 +0000
commit187e64806fca812453f6864b2bd6428c03c2c1a5 (patch)
treef14fbd3909d5e0097144ba6c1bae41e9df7dc0eb /Lib/test/test_itertools.py
parentc70e003f75f40f0dcce1a7b7e02bebe16204c985 (diff)
downloadcpython-git-187e64806fca812453f6864b2bd6428c03c2c1a5.tar.gz
backport of r51950
* 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
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 68987257d7..2baa507554 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'))