Lichen

Change of tests/chain.py

266:7267486338ae
tests/chain.py
     1.1 --- a/tests/chain.py	Mon Nov 28 00:59:41 2016 +0100
     1.2 +++ b/tests/chain.py	Mon Nov 28 01:00:10 2016 +0100
     1.3 @@ -31,9 +31,18 @@
     1.4      g = C.D.E.n
     1.5      h = C.D.p
     1.6  
     1.7 +    print c                                 # __main__.C
     1.8 +    print d                                 # __main__.C.D
     1.9 +    print e                                 # __main__.C.D.E
    1.10 +    print f                                 # __main__.C.D.E.m
    1.11 +    print g                                 # 123
    1.12 +    print h                                 # "456"
    1.13 +
    1.14  def static_via_constant():
    1.15      i = C.D.p.__len__
    1.16  
    1.17 +    print i                                 # __builtins__.str.basestring.__len__
    1.18 +
    1.19  def assign():
    1.20      C.D.q = 987
    1.21  
    1.22 @@ -46,12 +55,17 @@
    1.23  def broken():
    1.24      inst2 = C.D.F()
    1.25      l = inst2.u().__len__
    1.26 +    return l
    1.27  
    1.28  static()
    1.29  static_via_constant()
    1.30  assign()
    1.31 -result1 = indirect()
    1.32 -broken()
    1.33 +print indirect()                            # __builtins__.str.basestring.__len__
    1.34 +print indirect()()                          # 3
    1.35 +print broken()                              # __builtins__.str.basestring.__len__
    1.36 +print broken()()                            # 3
    1.37 +
    1.38 +print C.D.q                                 # 987
    1.39  
    1.40  # Static chains.
    1.41  
    1.42 @@ -62,21 +76,36 @@
    1.43  g = C.D.E.n
    1.44  h = C.D.p
    1.45  
    1.46 +print c                                     # __main__.C
    1.47 +print d                                     # __main__.C.D
    1.48 +print e                                     # __main__.C.D.E
    1.49 +print f                                     # __main__.C.D.E.m
    1.50 +print g                                     # 123
    1.51 +print h                                     # "456"
    1.52 +
    1.53  # Static via constant.
    1.54  
    1.55  i = C.D.p.__len__
    1.56  
    1.57 +print i                                     # __builtins__.str.basestring.__len__
    1.58 +print i()                                   # 3
    1.59 +
    1.60  # Static assignment.
    1.61  
    1.62 -C.D.q = 987
    1.63 +C.D.q = 654
    1.64 +
    1.65 +print C.D.q                                 # 654
    1.66  
    1.67  # Indirect accesses.
    1.68  
    1.69  inst = e()
    1.70  method = inst.m
    1.71 -result2 = method("5")
    1.72 +print method("5")                           # __builtins__.str.basestring.__len__
    1.73 +print method("5")()                         # 3
    1.74  
    1.75  # Broken chains.
    1.76  
    1.77  inst2 = C.D.F()
    1.78  l = inst2.u().__len__
    1.79 +print l                                     # __builtins__.str.basestring.__len__
    1.80 +print l()                                   # 3