1.1 --- a/tests/nested_mixed.py Mon Nov 28 00:59:41 2016 +0100
1.2 +++ b/tests/nested_mixed.py Mon Nov 28 01:00:10 2016 +0100
1.3 @@ -1,15 +1,23 @@
1.4 a = 4
1.5
1.6 def f(x):
1.7 +
1.8 + # Test function initialisation (f.$l0).
1.9 +
1.10 def g(y, x=x):
1.11 +
1.12 + # Test function initialisation (f.$l0.$l0).
1.13 +
1.14 def h(a, z, x=x, y=y):
1.15 return x, y, z, a # parameter a overrides global scope
1.16 +
1.17 return h
1.18 +
1.19 return g
1.20
1.21 -result = f(1)(2)(5, 3)
1.22 -print result[0]
1.23 -print result[1]
1.24 -print result[2]
1.25 -print result[3]
1.26 -assert result == (1, 2, 3, 5)
1.27 +fn = f(1)
1.28 +print fn # __main__.f.$l0
1.29 +print fn(2) # __main__.f.$l0.$l0
1.30 +print fn(2)(5, 3) # (1, 2, 3, 5)
1.31 +print fn(2)(5, 3, 6) # (6, 2, 3, 5)
1.32 +print fn(2)(5, 3, 6, 7) # (6, 7, 3, 5)