diff options
author | Raymond Hettinger <python@rcn.com> | 2010-11-30 02:49:29 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-11-30 02:49:29 (GMT) |
commit | 69b34bfe9c3e5da1d7336a607ab56f1c3a178dca (patch) | |
tree | 99a57401cce528c9fd1e50b67dcc81b27eafeaba /Lib | |
parent | ac9a2bb06762cb42881a1babc4e21f7cb656be62 (diff) | |
download | cpython-69b34bfe9c3e5da1d7336a607ab56f1c3a178dca.zip cpython-69b34bfe9c3e5da1d7336a607ab56f1c3a178dca.tar.gz cpython-69b34bfe9c3e5da1d7336a607ab56f1c3a178dca.tar.bz2 |
Issue #10323: Predictable final state for slice().
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_itertools.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 06777a1..fe6131a 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -788,6 +788,11 @@ class TestBasicOps(unittest.TestCase): self.assertRaises(ValueError, islice, range(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 |