Commit 7ee28046 authored by Stefan Behnel's avatar Stefan Behnel

additional test case

parent 3fb1a018
...@@ -305,6 +305,21 @@ def test_nested_yield(): ...@@ -305,6 +305,21 @@ def test_nested_yield():
""" """
yield (yield (yield 1)) yield (yield (yield 1))
def test_sum_of_yields(n):
"""
>>> g = test_sum_of_yields(3)
>>> next(g)
(0, 0)
>>> g.send(1)
(0, 1)
>>> g.send(1)
(1, 2)
"""
x = 0
x += yield (0, x)
x += yield (0, x)
yield (1, x)
def test_nested_gen(n): def test_nested_gen(n):
""" """
>>> [list(a) for a in test_nested_gen(5)] >>> [list(a) for a in test_nested_gen(5)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment