]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-93814: Add infinite test for itertools.chain.from_iterable (GH-93815)
authorJeong YunWon <69878+youknowone@users.noreply.github.com>
Tue, 14 Jun 2022 20:45:50 +0000 (05:45 +0900)
committerGitHub <noreply@github.com>
Tue, 14 Jun 2022 20:45:50 +0000 (13:45 -0700)
fix #93814

Automerge-Triggered-By: GH:rhettinger
Lib/test/test_itertools.py

index 238afbbd883d3a2b63b6aaf1cba7c816258d223e..f469bfe185e65b65dfa215fc2ad9259aa6932f0b 100644 (file)
@@ -180,6 +180,7 @@ class TestBasicOps(unittest.TestCase):
         self.assertEqual(list(chain.from_iterable([''])), [])
         self.assertEqual(take(4, chain.from_iterable(['abc', 'def'])), list('abcd'))
         self.assertRaises(TypeError, list, chain.from_iterable([2, 3]))
+        self.assertEqual(list(islice(chain.from_iterable(repeat(range(5))), 2)), [0, 1])
 
     def test_chain_reducible(self):
         for oper in [copy.deepcopy] + picklecopiers: