MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_zip

Method test_zip

Lib/test/test_itertools.py:775–789  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

773 self.assertRaises(TypeError, next, filterfalse(range(6), range(6)))
774
775 def test_zip(self):
776 # XXX This is rather silly now that builtin zip() calls zip()...
777 ans = [(x,y) for x, y in zip('abc',count())]
778 self.assertEqual(ans, [('a', 0), ('b', 1), ('c', 2)])
779 self.assertEqual(list(zip('abc', range(6))), lzip('abc', range(6)))
780 self.assertEqual(list(zip('abcdef', range(3))), lzip('abcdef', range(3)))
781 self.assertEqual(take(3,zip('abcdef', count())), lzip('abcdef', range(3)))
782 self.assertEqual(list(zip('abcdef')), lzip('abcdef'))
783 self.assertEqual(list(zip()), lzip())
784 self.assertRaises(TypeError, zip, 3)
785 self.assertRaises(TypeError, zip, range(3), 3)
786 self.assertEqual([tuple(list(pair)) for pair in zip('abc', 'def')],
787 lzip('abc', 'def'))
788 self.assertEqual([pair for pair in zip('abc', 'def')],
789 lzip('abc', 'def'))
790
791 @support.impl_detail("tuple reuse is specific to CPython")
792 def test_zip_tuple_reuse(self):

Callers

nothing calls this directly

Calls 6

countFunction · 0.85
listClass · 0.85
lzipFunction · 0.85
takeFunction · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected