Lichen

Changeset

639:93254c89358b
2017-02-28 Paul Boddie raw files shortlog changelog graph Added testing of temporary result variable availability.
tests/logical_simple.py (file)
     1.1 --- a/tests/logical_simple.py	Tue Feb 28 17:18:48 2017 +0100
     1.2 +++ b/tests/logical_simple.py	Tue Feb 28 19:22:58 2017 +0100
     1.3 @@ -1,12 +1,18 @@
     1.4  def no_temp(a, b):
     1.5      return not (a and b)
     1.6  
     1.7 +def uses_temp(a, b):
     1.8 +    return a and b
     1.9 +
    1.10 +def also_uses_temp(a, b):
    1.11 +    return a or b
    1.12 +
    1.13  a = 1
    1.14  b = 2
    1.15 -c = a and b
    1.16 +c = uses_temp(a, b)
    1.17  print c                             # 2
    1.18  
    1.19 -d = a or b
    1.20 +d = also_uses_temp(a, b)
    1.21  print d                             # 1
    1.22  
    1.23  e = not a