Author: Armin Rigo <[email protected]>
Branch:
Changeset: r85029:e5fe19dddeea
Date: 2016-06-08 16:33 +0200
http://bitbucket.org/pypy/pypy/changeset/e5fe19dddeea/
Log: Another test
diff --git a/rpython/rtyper/test/test_generator.py
b/rpython/rtyper/test/test_generator.py
--- a/rpython/rtyper/test/test_generator.py
+++ b/rpython/rtyper/test/test_generator.py
@@ -113,3 +113,21 @@
return s
res = self.interpret(g, [])
assert res == 6
+
+ def test_generator_with_unreachable_yields(self):
+ def f(n):
+ if n < 0:
+ yield 42
+ yield n
+ if n < 0:
+ yield 43
+ yield n
+ if n < 0:
+ yield 44
+ def main(n):
+ y = 0
+ for x in f(abs(n)):
+ y += x
+ return y
+ res = self.interpret(main, [-100])
+ assert res == 200
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit