summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-09-29 11:40:50 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-09-29 11:40:50 (GMT)
commitff5dc0ee7740feba895e7ddfbdda37d9064c045e (patch)
tree35e5c74f9dbc5a9eadca01bbf6d6e6c29431f648 /Lib/test/test_itertools.py
parentbcab2b25f9bf4024ed10319cf65394d44aa9b023 (diff)
downloadcpython-ff5dc0ee7740feba895e7ddfbdda37d9064c045e.zip
cpython-ff5dc0ee7740feba895e7ddfbdda37d9064c045e.tar.gz
cpython-ff5dc0ee7740feba895e7ddfbdda37d9064c045e.tar.bz2
Improve test coverage.
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index 02f84b7..aa80910 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -420,6 +420,14 @@ class TestGC(unittest.TestCase):
a = []
self.makecycle(cycle([a]*2), a)
+ def test_dropwhile(self):
+ a = []
+ self.makecycle(dropwhile(bool, [0, a, a]), a)
+
+ def test_groupby(self):
+ a = []
+ self.makecycle(groupby([a]*2, lambda x:x), a)
+
def test_ifilter(self):
a = []
self.makecycle(ifilter(lambda x:True, [a]*2), a)
@@ -440,10 +448,18 @@ class TestGC(unittest.TestCase):
a = []
self.makecycle(islice([a]*2, None), a)
+ def test_repeat(self):
+ a = []
+ self.makecycle(repeat(a), a)
+
def test_starmap(self):
a = []
self.makecycle(starmap(lambda *t: t, [(a,a)]*2), a)
+ def test_takewhile(self):
+ a = []
+ self.makecycle(takewhile(bool, [1, 0, a, a]), a)
+
def R(seqn):
'Regular generator'
for i in seqn: