示例#1
0
 def test_consume(self):
     # full consuming, without limitation
     r = iters.range(10)
     self.assertEqual(10, len(list(r)))
     itr = iter(r)
     iters.consume(itr)
     self.assertEqual(0, len(list(itr)))
示例#2
0
文件: tests.py 项目: Gizmo707/fn.py
 def test_consume(self):
     # full consuming, without limitation
     r = iters.range(10)
     self.assertEqual(10, len(list(r)))
     itr = iter(r)
     iters.consume(itr)
     self.assertEqual(0, len(list(itr)))
示例#3
0
 def test_consume_limited(self):
     r = iters.range(10)
     self.assertEqual(10, len(list(r)))
     itr = iter(r)
     iters.consume(itr, 5)
     self.assertEqual(5, len(list(itr)))
示例#4
0
文件: tests.py 项目: Gizmo707/fn.py
 def test_consume_limited(self):
     r = iters.range(10)
     self.assertEqual(10, len(list(r)))
     itr = iter(r)
     iters.consume(itr, 5)
     self.assertEqual(5, len(list(itr)))