1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/attribute_access_type_restriction_loop.py Thu Feb 25 01:22:21 2010 +0100
1.3 @@ -0,0 +1,32 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +class C:
1.7 + def f(self):
1.8 + return 1
1.9 +
1.10 +class D:
1.11 + def f(self):
1.12 + return 0 # stops the test loop
1.13 +
1.14 + def g(self):
1.15 + return 3
1.16 +
1.17 +class E:
1.18 + def f(self):
1.19 + return 4
1.20 +
1.21 + def h(self): # unused
1.22 + return 5
1.23 +
1.24 +def test_loop(obj, obj2):
1.25 + while obj.f():
1.26 + obj = obj2
1.27 + obj.g()
1.28 + return obj.f()
1.29 +
1.30 +c = C()
1.31 +d = D()
1.32 +e = E()
1.33 +result1_0 = test_loop(c, d)
1.34 +
1.35 +# vim: tabstop=4 expandtab shiftwidth=4