summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2010-11-30 03:15:35 (GMT)
committerRaymond Hettinger <python@rcn.com>2010-11-30 03:15:35 (GMT)
commit061bf7a11a390c70dc6660691518241679a1698e (patch)
tree6905cd12a19a363b9c9985c337e977f110c82a62 /Lib/test/test_itertools.py
parent1fea5c4472b29fff85ae40a8d7f0c845347ad5c6 (diff)
downloadcpython-061bf7a11a390c70dc6660691518241679a1698e.zip
cpython-061bf7a11a390c70dc6660691518241679a1698e.tar.gz
cpython-061bf7a11a390c70dc6660691518241679a1698e.tar.bz2
Issue #10323: Predictable final state for slice().
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 2ef35d6..e416755 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -778,6 +778,11 @@ class TestBasicOps(unittest.TestCase):
self.assertRaises(ValueError, islice, xrange(10), 1, 'a', 1)
self.assertEqual(len(list(islice(count(), 1, 10, maxsize))), 1)
+ # Issue #10323: Less islice in a predictable state
+ c = count()
+ self.assertEqual(list(islice(c, 1, 3, 50)), [1])
+ self.assertEqual(next(c), 3)
+
def test_takewhile(self):
data = [1, 3, 5, 20, 2, 4, 6, 8]
underten = lambda x: x<10